Solved

need a quest AD CMDLET or POSH script to bulk move user accounts to another OU

Posted on 2013-01-07
2
631 Views
Last Modified: 2013-01-07
looking for a script to bulk move users to another OU based on a .CSV input file.

thx in advance.

S.
0
Comment
Question by:siber1
2 Comments
 
LVL 12

Accepted Solution

by:
FDiskWizard earned 500 total points
ID: 38751168
Pretty simple to do that. Need userid/name, or user-specific in the csv.
See below, from this site:
http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/dd9821b9-9c49-4d93-b5af-c79f927d724c/


# Specify target OU.
$TargetOU = "ou=NewUsers,ou=West,dc=MyDomain,dc=com"

# Read user sAMAccountNames from csv file (field labeled "Name").
Import-Csv -Path Users.csv | ForEach-Object {
    # Retrieve DN of User.
    $UserDN = (Get-ADUser -Identity $_.Name).distinguishedName

    # Move user to target OU.
    Move-ADObject -Identity $UserDN -TargetPath $TargetOU
}
0
 

Author Closing Comment

by:siber1
ID: 38751324
works great. thx
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
how to add IIS SMTP to handle application/Scanner relays into office 365.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question