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?

Matt Fogleman
  • 95
  • 1
  • 8

2 Answers2

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

Greg Askew
  • 35,880
  • 5
  • 54
  • 82
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

Ankh2054
  • 1,414
  • 13
  • 23