Removing AD Attributes

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: , , ,

0 Responses to “Removing AD Attributes”


  1. No Comments

Leave a Reply




View Dmitry Sotnikov's profile on LinkedIn

Archives

See you at:

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer Quest Software or anyone else for that matter. All trademarks acknowledged.

© 2007 Dmitry Sotnikov