Modifying an Attribute for Several Users at Once
This topic explains how to use the Active Directory module for Windows PowerShell to modify an attribute in Active Directory Domain Services (AD DS) for several users at once.
Example
The following example demonstrates how to retrieve the user objects in the organizational unit (OU) Finance and set their description attribute:
Get-ADUser -Filter 'Name -like "*"' -SearchBase "OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM" | Set-ADUser -Description "Member of the Finance Department"
Get-ADUser -Filter 'Name -like "*"' -SearchBase "OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM" | Set-ADUser -Description "Member of the Finance Department"
Additional information
You can use the following parameters when you set many of the common values that are associated with a user object in AD DS:
- -AccountExpirationDate
- -AccountNotDelegated
- -AccountPassword
- -AllowReversiblePasswordEncryption
- -CannotChangePassword
- -ChangePasswordAtLogon
- -Enabled
- -PasswordNeverExpires
- -PasswordNotRequired
- -SmartcardLogonRequired
- -TrustedForDelegation
- -DisplayName
- -GivenName
- -Initials
- -OtherName
- -Surname
- -Description
- -City
- -Country
- -POBox
- -PostalCode
- -State
- -StreetAddress
- -Company
- -Department
- -Division
- -EmployeeID
- -EmployeeNumber
- -Manager
- -Office
- -Organization
- -Title
- -Fax
- -HomePhone
- -MobilePhone
- -OfficePhone
- -EmailAddress
- -HomeDirectory
- -HomeDrive
- -HomePage
- -ProfilePath
- -ScriptPath
- -Certificates
- -LogonWorkstations
- -PermittedLogonTimes
- -UserPrincipalName
- -ServicePrincipalNames
- City
- Country
- EmailAddress
- Fax
- LogonWorkstations
- MobilePhone
- Office
- OfficePhone
- Organization
- OtherName
- POBox
- SmartcardLogonRequired
- State
- Surname
No comments:
Post a Comment