Skip Ribbon Commands
Skip to main content

Title

I don't like creating user accounts in the default User OU...

Body

...so, I added a Department header in the CSV and appended valid department names which are the same as the department OUs, then added some code in the foreach loop:

#Set the OU path for new accounts, otherwise they'll go to the default User OU
        $Dept = 'OU=' + $user.department
        $MoveOU = $Dept + ",OU=Departments,OU=Accounts,DC=usroboto,DC=com"

I also added "-Path $MoveOU" to New-ADUser cmdlet in the foreach block.

Today's date

7/18/2017

Twitter

 
Approval Status Pending
 

Attachments

Created at 7/18/2017 1:44 PM by  
Last modified at 7/18/2017 1:44 PM by