2014-02-12 127 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}