31 C
Dubai
Monday, November 4, 2024

QuickTip- Move-Adobject – Windows 2012 R2

image_thumb1

 

If we want to move AD objects (E.g users) across domains or Same Domain . (Note: This Command doesn’t work across forsest)

Let me Move some 3 Users from One OU to Different OU.

In this Below example – am listing Objects like user where name starts with GG ,Specifying the Target path .

(Note : You can get the Target path from the distinguishedname attribute of the OU)

 

PS — On a Domain Controller run Windows Server 2012 R2

Import-Module ActiveDirectory

Get-ADObject  -Filter {(Objectclass -like “user”) -and (name -like “GG*”)}  | Move-ADObject -TargetPath “OU=IT,DC=testcareexchange,DC=biz” -Verbose

image

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?