Updating attributes on a user object or computer object in your Active Directory can be done very easily. Thanks to Windows PowerShell and the Set-ADUser cmdlet, it is possible to populate a value and/or clear a value. Let’s see how to perform this task.
In the example below, I will add a value to the “extensionAttribute15” attribute:
PS > Set-ADUser -Identity $user -Add @{extensionAttribute15 = "Welcome"}
You can also use the Set-ADComputer cmdlet in order to update a value on a computer obkect.
Now, if you need to remove a value, you must replace -Add with -Clear parameter:
PS > Set-ADUser –Identity $user -Clear "extensionAttribute15"
Please note that if a value already exists in the attribute, then you must clear the value before adding a new one.
Thanks for reading! You can follow me on Twitter @PrigentNico