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

1 Response to “Renaming AD Objects”


  1. 1 Oleg Kamnev October 3, 2009 at 2:18 pm

    Thanks for the suggestion!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




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
« Jul   Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031  

%d bloggers like this: