2

Been trying to build a CSV file to import users into Active Directory. I can get everything to populate, except for E-mail, Password, and Enabling the user. Just using this cmdlet in Powershell.

Import-CSV "C:\Users\Administrator\Downloads\adimport.csv" | new-ADUser 

This is what my CSV looks like.

CSV File

For some reason the E-Mail field in the General tab won't fill. I'm also not sure what column header to use to enable the profile, and I think password is userPassword, right?

Is there something i'm doing wrong that the E-Mail field won't fill in?

2 Answers 2

3

Try rename field in csv from mail to EmailAddress

New-ADUser accepts a property of EmailAddress, but not mail. Some of these correspond to an AD attribute, but not all.

New-ADUser
https://technet.microsoft.com/en-us/library/ee617253.aspx

3
  • That was it, didn't see that anywhere in the Attribute Editor and everything I had read said to use mail Commented Apr 22, 2015 at 17:55
  • You can try: get-AdUser -filter 'samAccountName -like "Administrator"' -properties *|Get-Member to view all properties of the object Commented Apr 22, 2015 at 18:20
  • Ahh, thank you so much. Most of the stuff I was reading was from Server 2008, so maybe they changed that property name. Commented Apr 22, 2015 at 18:25
1

Here is list of all Get-aduser default and extended properties.

http://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.