AD: How To Populate extensionAttribute using PowerShell?

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:

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:

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

About Nicolas 245 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 8 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.