Solved

Importing Mac addresses as users into Active Directory

Posted on 2012-12-27
3
347 Views
Last Modified: 2013-01-16
I'm trying to use the import-CSV | New-ADUser setup to import a csv of about 2000 people into a group in AD. I'm trying to come up with what to name the headers of the csv for this to work to attain the following:

First Name
Last Name
display name
password
set the "Password Never Expires" attribute
set the "User cannot change Password" attribute
Enable the account for immediate use
0
Comment
Question by:Casey Weaver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 300 total points
ID: 38725403
How you name your CSV headers is up to you, and has absolutely no effect but as how the properties of the dynamic objects created from the CSV are named. For easier access I recommend not to use spaces and special characters.

BUT, if you name the CSV headers exactly as the parameters to New-ADUser (Name, GivenName, Display etc., see help of New-ADUser), you are able to just pipe the CSV into the cmdlet:
import-csv ThisIsMyFile.csv | New-ADUser

Open in new window

and that is probably what you are asking for. If you name the headers differently, you will need to process the CSV:
import-csv ThisIsMyFile.csv | % { New-ADUser -DisplayName $_.DisplayName -GivenName $_.LastName <# aso. #> }

Open in new window

0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 200 total points
ID: 38726324
If you are using import-CSV test.csv | New-ADUser, then the AD accounts created will not be enabled by default, it's because New-ADUser requires a Secure String for the Password and the password from csv file will be plain text.

You may refer the following article for example..
http://blogs.technet.com/b/samdrey/archive/2011/09/26/bulk-populate-an-ad-using-a-csv-file-and-new-aduser-including-passwords.aspx
0
 
LVL 7

Author Closing Comment

by:Casey Weaver
ID: 38783487
The top solution was exactly what I needed. We also made renditions for our newer server in Powershell so we used that as well. Thanks guys!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

734 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