Bri*_*ale 3 powershell active-directory
当我help set-aduser
在PowerShell命令行输入时,我会得到下面列出的信息.我有兴趣改变的财产是办公室.
根据下面列出的信息,该属性指定为-office
.但AD命名办公室没有属性,实际上就是这样physicalDeliveryOfficeName
.他们都在AD中引用相同的属性吗?为什么这样,我会认为我只能指定LDAP名称?
NAME
Set-ADUser
SYNOPSIS
Modifies an Active Directory user.
SYNTAX
Set-ADUser [-Identity] <ADUser>
[-AccountExpirationDate <System.Nullable[System.DateTime]>]
[-AccountNotDelegated <System.Nullable[bool]>] [-Add <hashtable>]
[-AllowReversiblePasswordEncryption <System.Nullable[bool]>]
[-CannotChangePassword <System.Nullable[bool]>] [-Certificates <hashtable>]
[-ChangePasswordAtLogon <System.Nullable[bool]>] [-City <string>]
[-Clear <string[]>] [-Company <string>] [-Country <string>] [-Department <string>]
[-Description <string>] [-DisplayName <string>] [-Division <string>]
[-EmailAddress <string>] [-EmployeeID <string>] [-EmployeeNumber <string>]
[-Enabled <System.Nullable[bool]>] [-Fax <string>] [-GivenName <string>]
[-HomeDirectory <string>] [-HomeDrive <string>] [-HomePage <string>]
[-HomePhone <string>] [-Initials <string>] [-LogonWorkstations <string>]
[-Manager <ADUser>] [-MobilePhone <string>] [-Office <string>]
[-OfficePhone <string>] [-Organization <string>] [-OtherName <string>]
[-PasswordNeverExpires <System.Nullable[bool]>]
[-PasswordNotRequired <System.Nullable[bool]>] [-POBox <string>]
[-PostalCode <string>] [-ProfilePath <string>]
[-Remove <hashtable>] [-Replace <hashtable>] [-SamAccountName <string>]
[-ScriptPath <string>] [-ServicePrincipalNames <hashtable>]
[-SmartcardLogonRequired <System.Nullable[bool]>] [-State <string>]
[-StreetAddress <string>] [-Surname <string>] [-Title <string>]
[-TrustedForDelegation <System.Nullable[bool]>]
[-UserPrincipalName <string>] [-AuthType {Negotiate | Basic}]
[-Credential <PSCredential>] [-Partition <string>] [-PassThru <switch>]
[-Server <string>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-ADUser -Instance <ADUser> [-SamAccountName <string>] [-AuthType {Negotiate | Basic}] [-Credential <PSCredential
>] [-Partition <string>] [-PassThru <switch>] [-Server <string>] [-Confirm] [-WhatIf] [<CommonParameters>]
Run Code Online (Sandbox Code Playgroud)
小智 8
如果您更喜欢LDAP名称,则可以将它们与-Remove,-Add,-Replace或-Clear参数一起使用,而不是使用与LDAP名称不同的任何常规参数.将属性和值放在哈希表中,用分号分隔多个属性,用逗号分隔多个值.
Set-ADUser -Identity CitizenRon -Replace @{physicalDeliveryOfficeName=Downtown;mail=citizenron@somewhere.com;telephoneNumber=888-888-8888;otherTelephone=999-999-9999,777-777-7777}
Run Code Online (Sandbox Code Playgroud)
他们是一样的。有关通过 powershell Active Directory cmdlet 提供的扩展属性列表以及它们各自引用的 lDAPDisplayName,您可以参考: http ://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-获取-aduser-默认-和-扩展-properties.aspx
我认为他们为了方便起见提供“office”而不是 LDAP 名称,因为它要短得多。
以下命令行:
Set-ADUser admInst1 -Office "##OFFICE##"
Run Code Online (Sandbox Code Playgroud)
设置physicalDeliveryOfficeName
属性。
正如你在这里看到的:
归档时间: |
|
查看次数: |
51818 次 |
最近记录: |