Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Rename user accounts in AD from file (e.g., .CSV)

$
0
0

We have Windows Server 2008 R2 Domain Controllers.

We have user accounts in an OU called "Students", which in turn have child OUs separating the students by graduating years (e.g., 2014, 2015, 2016).  The students use their Student ID (e.g., 0123456789) to login.  We would like for the students to use a different naming convention (i.e., first initial of first name, first initial of middle name, and last name) such as, "SLJackson" for Samuel L. Jackson.    

I'm not familiar with scripting at all, but I found that I can probably use the Rename-ADObject cmdlet for this task.  

Example: Rename-ADObject 'CN=0123456789,OU=2014,OU=Students,OU=AnotherSchoolOU,DC=SchoolNameHere,DC=com' -NewName 'SLJackson'

Source: http://technet.microsoft.com/en-us/library/dd391929(v=ws.10).aspx 

However, I don't know how to utilize that cmdlet to do this task from a spreadsheet containing all the student's full names.

I'm searching online for some sample code, since I can only imagine I'm not the first to do this...but my researching is weak :(


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>