当我在PowerShell命令行输入help set-aduser
时,我会得到下面列出的信息。我有兴趣改变的财产是办公室。
根据下面列出的信息,该属性指定为-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>]
答案 0 :(得分:6)
如果您更喜欢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}
答案 1 :(得分:4)
他们是同一个人。有关通过powershell活动目录cmdlet可用的扩展属性的列表,以及它们各自引用的lDAPDisplayName,您可以引用: http://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx
我认为它们提供'办公室'而不是LDAP名称是为了方便,因为它要短得多。
答案 2 :(得分:2)
以下命令行:
Set-ADUser admInst1 -Office "##OFFICE##"
设置physicalDeliveryOfficeName
属性。
正如你在这里看到的那样: