31.8 C
Dubai
Thursday, August 18, 2022
spot_img

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
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here