Modify attributes of a user account in Active Directory.
Syntax
Set-QADUser [[-Identity] IdentityParameter] ADProperties
[-AccountExpires Nullable] [-PasswordNeverExpires]
[-UserMustChangePassword] TerminalServiceProperties
[-UserPassword String] Advanced_Options
[-WhatIf] [-Confirm]
Key
-identity The Distinguished Name (DN), Canonical Name, GUID or, where applicable,
the Domain\Name, UPN or SID of the object you wish to find.
-AccountExpires
Set the account expiration date
-PasswordNeverExpires
Set to True to never expire the account password
ADProperties
Set object properties:
[-Manager IdentityParameter] [-City String] [-Company String]
[-Department String] [-Fax String] [-FirstName String]
[-HomePhone String] [-Initials String] [-LastName String]
[-MobilePhone String] [-Notes String] [-Office String]
[-Pager String] [-PhoneNumber String] [-PostalCode String]
[-PostOfficeBox String] [-SamAccountName String] [-StateOrProvince String]
[-StreetAddress String] [-Title String] [-UserPrincipalName String]
[-WebPage String] [-HomeDirectory String] [-HomeDrive String]
[-ProfilePath String] [-LogonScript String] [-Email String]
[-Description String] [-DisplayName String] [-Name String]
TerminalServiceProperties:
[-TsProfilePath String] [-TsHomeDirectory String]
[-TsHomeDrive String] [-TsWorkDirectory String]
[-TsInitialProgram String] [-TsMaxDisconnectionTime TimeSpan]
[-TsMaxConnectionTime TimeSpan] [-TsMaxIdleTime TimeSpan]
[-TsAllowLogon] [-TsRemoteControl Int32] [-TsReconnectionAction Int32]
[-TsBrokenConnectionAction Int32] [-TsConnectClientDrives]
[-TsConnectPrinterDrives] [-TsDefaultToMainPrinter]
Advanced_Options:
[-ObjectAttributes ObjectAttributesParameter]
[-ExcludedProperties String[]] [-IncludedProperties String[]]
[-DeserializeValues] [-UseDefaultExcludedProperties]
[-Proxy] [-UseGlobalCatalog] [-Service String]
[-ConnectionAccount String] [-ConnectionPassword SecureString]
[-Credential PSCredential] [-Connection ArsConnection]
Notes:
By default Set-QADUser will connect to any available domain controller with the credentials of the locally logged on user, to connect to a specific domain controller using a specific account, either use the advanced options (-Proxy/-Service/-ConnectionAccount) or use the Connect-QADService cmdlet to make the connection.
Examples
Change the description for JDoe
PS C:> Set-QADUser 'CN=JDoe,CN=Users,DC=SS64,DC=com' -description 'Fall guy'
Assign two values to the multi-valued attribute "otherTelephone" for JDoe:
PS C:> Set-QADUser 'SS64.com/usersOU/JDoe' -objectAttributes @{otherTelephone=@('0208 124 2244','0207 468 2323')}
Clear the multi-valued attribute "otherTelephone" for JDoe:
PS C:> Set-QADUser 'SS64.com/usersOU/JDoe' -objectAttributes @{otherTelephone=''}
“Those who flee temptation generally leave a forwarding address” ~ Lane Olinghouse
Related:
PowerGui Wiki for New-QADUser
Get-QADComputer
Get-QADGroup
© Copyright SS64.com 1999-2013
Some rights reserved