Adding and removing extensionattribute to AD object
You could try using the -Clear
parameter
Example:-Clear Attribute1LDAPDisplayName, Attribute2LDAPDisplayName
I used the following today - It works!
Add a value to an extensionAttribute
$ThisUser = Get-ADUser -Identity $User -Properties extensionAttribute1 Set-ADUser –Identity $ThisUser -add @{"extensionattribute1"="MyString"}
Remove a value from an extensionAttribute
$ThisUser = Get-ADUser -Identity $User -Properties extensionAttribute1 Set-ADUser –Identity $ThisUser -Clear "extensionattribute1"
I have struggled a long time to modify the extension attributes in our domain.Then I wrote a powershell script and created an editor with a GUI to set and remove extAttributes from an account.
If you like, you can take a look at it at http://toolbocks.de/viewtopic.php?f=3&t=4
I'm sorry, that the description in the text is in German. The GUI itself is in English.
I use this script on a regular basis in our domain and it never deleted anything or did any other harm. I provide no guarantee, that this script works as expected in your domain. But as I provide the source, you can (and should) have a look at it, before you run it.