2014-02-12 126 views
2

當我在PowerShell命令行鍵入help set-aduser時,我得到下面列出的信息。我感興趣的財產是辦公室。set-aduser屬性與AD屬性不同?

根據下面列出的信息,該屬性被指定爲-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>] 

回答

2

下面的命令行:

Set-ADUser admInst1 -Office "##OFFICE##" 

設置physicalDeliveryOfficeName屬性。

正如你可以在這裏看到:

enter image description here enter image description here

5

如果你喜歡LDAP名稱,你可以用-Remove,-Add,-replace或 - 清除參數,而不是任何使用它們常規參數與LDAP名稱不同。將屬性和值放在散列表中,用逗號分隔多個具有分號和多個值的屬性。

Set-ADUser -Identity CitizenRon -Replace @{physicalDeliveryOfficeName=Downtown;[email protected];telephoneNumber=888-888-8888;otherTelephone=999-999-9999,777-777-7777}