All those Set-* cmdlets are great at changing an attribute in AD, but how do you remove an attribute completely?
The answer is really straight-forward - you just set it to $null.
For example, to remove my City attribute I could use something like:
Set-QADUser "Dmitry Sotnikov" -City $null
In the general case of any attribute and any object use this syntax:
Set-QADObject identity –ObjectAttribute @{attributeName=$null}
Where identity is anything that can identify the object: samAccountName, DN, GUID, SID, canonical name; and attributeName is the name of the attribute you want to remove.
I guess this is one of those cases when the solution is so obvious you just forget to blog about it (until you get an IM from someone like xaegr asking ;))
Related topics:
Tags: AD, AD cmdlets, Active Directory, PowerShell
Subscribe by email






0 Responses to “Removing AD Attributes”