Weekly quickTIP

You Move Me

Move objects at will with the DSMOVE command.

So far you’ve used DSADD and DSMOD to create and update information about objects in Active Directory. But what if you need to rename the object itself or move it to another location? This time out, you'll learn to use the DSMOVE command.

Unlike the other commands we’ve just covered, DSMOVE has very few switches. Following the example of John Brown the new sales person, what would you do if John Brown had to change his name to protect the innocent? DSMOVE can be your own witness protection program:

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the MCPmag.com editors at mailto:[email protected]; the best questions get answered in this column and garner the questioner with a nifty Redmond T-shirt.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)

dsmove "cn=John Brown,ou=Sales People,dc=FirstClassCorp,dc=com"
-newname "John Doe"

Don’t forget to use DSMOD to update his first and last name within the user object as well.

Now, if you're to completely shield Mr. Doe, you'll have to move him from the outside Sales organization to the internal R&D organization. Let’s move his user object from the Sales People OU to the Research People OU, also using DSMOVE:

dsmove "cn=John Doe,ou=Sales People,dc=FirstClassCorp,dc=com"
-newparent "ou=Research People,dc=FirstClassCorp,dc=com"

Getting tired yet of typing all these distinguished names -- especially when there’re multiple objects to update? We'll discuss the DSQUERY command and redirecting or "piping" output to create the lists for you, but you'll have to wait until next time.

About the Author

Greg Shields is Author Evangelist with PluralSight, and is a globally-recognized expert on systems management, virtualization, and cloud technologies. A multiple-year recipient of the Microsoft MVP, VMware vExpert, and Citrix CTP awards, Greg is a contributing editor for Redmond Magazine and Virtualization Review Magazine, and is a frequent speaker at IT conferences worldwide. Reach him on Twitter at @concentratedgreg.

comments powered by Disqus
Most   Popular

Upcoming Training Events

0 AM
Live! 360 Orlando
November 17-22, 2024
TechMentor @ Microsoft HQ
August 11-15, 2025