Update custom attributes in Windows Active Directory user object
To check the current value (one user)
Get-ADUser username -Properties myAttribute1, myAttribute2 | select SamAccountName, myAttribute1, myAttribute 2
To check the current value (all users)
Get-ADUser -filter {myAttribute1 -ge '1'} -Properties myAttribute1, myAttribute2 | select SamAccountName, myAttribute1, myAttribute2 | out-file myResult.txt
To update:
Set-ADUser username -replace @{myAttribute1="myValue1"; myAttribute2="myValue2"}
Comments