Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set-aduser attributes different than AD properties?

When I type help set-aduser at the PowerShell command line, I get the information listed below. The property that I am interested in changing is the office.

According to the information listed below, that attribute is specified as -office. But there is no attribute in AD named office, it is actually physicalDeliveryOfficeName. Do they both refer to the same attribute in AD? Why is this, I would think that I can just specify the LDAP name?

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>]
like image 382
BriceTRockindale Avatar asked Dec 03 '22 20:12

BriceTRockindale


2 Answers

If you prefer LDAP names, you can use them with the -Remove, -Add, -Replace or -Clear parameters instead of any of the regular parameters that are different than LDAP names. Place the attributes and values in a hash table, separate multiple attributes with semicolons and multiple values with commas.

Set-ADUser -Identity CitizenRon -Replace @{physicalDeliveryOfficeName=Downtown;[email protected];telephoneNumber=888-888-8888;otherTelephone=999-999-9999,777-777-7777}
like image 142
CitizenRon Avatar answered Dec 06 '22 18:12

CitizenRon


They are one and the same. For a list of the extended properties available through the powershell active directory cmdlets, and the lDAPDisplayName they each refer to you can reference: http://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx

I assume they offer 'office' instead of the LDAP name for convenience since it is considerably shorter.

like image 43
TheMadTechnician Avatar answered Dec 06 '22 18:12

TheMadTechnician