user information import

chencharlie1
chencharlie1 used Ask the Experts™
on
Dear experts:
we have about 500 users in our active directory domain.
There are user information saved in csv format such as name, title, phone number etc.
How do we input these information into our existing active directory in windows AD Domain controller.  Is there any risk by doing so?
Thanks,
Charlie
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Victor TarasovHead of system administration department
Commented:
You can write simple .NET application. They can parse csv file, find object in AD and change properties.
Here's the syntax to use for CSV import:

csvde [-f filename] [-k]

Here's an example of the CSV file:

DN,objectclass,smaccountname,sn,givenname,userprincipalname

"cn=Lisa Andrews,ou=people,dc=contoso.com",user,lisa.andrews,Lisa Andrews,lisa.andrews@contoso.com

Here's the caveat:

You cannot use the CSVDE to import passwords, and without a password, the user account will be disabled initially. After you have reset the password, you can enable the object.
Victor TarasovHead of system administration department

Commented:
like This
You can also look at products by Dovestone software. They make a great suite of products at reasonable prices to generate info from AD and to bulk enter info into AD.

http://www.dovestones.com/

Author

Commented:
Hi motnahp00,
We just need to modify existing user information without touching password.
Do we still need to disable user account during the import?
Thanks,
Charlie
You will want to use the dsmod command instead.

Example:

dsmod "cn=Tony Smith,ou=People,dc=contoso,dc=com" -office "Sydney"
An easier way of pulling the distinguished name for users if you don't already have it is by using dsquery:

dsquery user -name administrator
"CN=Administrator,CN=Users,DC=contoso,dc=com"
IT Consultant
Commented:
No need to download other software. Just use Microsoft's Powershell to import the users.
You need to create these user accounts, correct?

This would create the user account and mailbox:
$Password = Read-Host "Enter Password" -AsSecureString
Import-CSV "c:\importusers\userlist.csv" | ForEach {New-Mailbox -Alias $_.alias -Name $_.name -FirstName $_.fn -Initials $_.initials -LastName $_.ln -userPrincipalName $_.UPN -Database "exchangeServer\Exchange Mailbox Database" -OrganizationalUnit "NewUserOU" -Password $Password -ResetPasswordOnNextLogon $true}

Open in new window


where the csv looks something like:
alias,name,ln,fn,initials,upn
smithj,"Smith, John K", Smith,John,K,john.k.smith@blah.com

Open in new window


If you're simply just looking to create the user account only (no mailbox), you would use "new-aduser" instead of "new-mailbox" as discussed here
http://mikefrobbins.com/2011/06/30/create-an-active-directory-user-account-with-powershell/

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial