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

looking for a script to bulk move users to another OU based on a .CSV input file.

thx in advance.

Who is Participating?
FDiskWizardConnect With a Mentor Commented:
Pretty simple to do that. Need userid/name, or user-specific in the csv.
See below, from this site:

# 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
siber1Author Commented:
works great. thx
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.