Archive for August 23rd, 2007

Renaming AD Objects

Another new cmdlet in the 1.0.4 release is Rename-QADObject. Here are a few examples of how it works.

Rename-QADObject dsotnikov -NewName "Dmitry Sotnikov"

In this particular case I’ve used the existing name to find the user and then supplied a new one.

Instead of providing a name (or any other identifier such as UPN, Domain\Username, SID, DC, CN, etc.) you can pipe an output of another cmdlet into this one.

For example, to add a postfix to all users from London OU:

Get-QADUser -OU ps64.local/London | ForEach { Rename-QADObject $_ -NewName ($_.Name + "-London"}

One thing to keep in mind is that this command will change the Name attribute as well as distinguished name (DN) and canonical name, but not other related attributes such as samAccountName or UPN. If you need to change more properties use the good old Set-QADUser (or depending on object class another set- cmdlet.)

Tags: , , , , , , ,


My Recent Tweets

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 - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

August 2007
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

%d bloggers like this: