Solved

Importing Mac addresses as users into Active Directory

Posted on 2012-12-27
3
327 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
3 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now