Solved

Importing Mac addresses as users into Active Directory

Posted on 2012-12-27
3
343 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 69

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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