Creating a New Mail User from Csv file
Hi, Im trying to import Users from a Csv file that was created from AD. The Users have User accounts in AD and I want to import them from Csv file into Exchange 2007 so they are Mail Users ( with External Email Addresses). My Csv file format is DisplayName,FirstName,LastName,EMailAddressThanks again..
June 9th, 2009 5:36pm

You need to add a more field in CSV file UPN in user@domainname.com format and below is the script... $Pass=Read-Host "Enter Password" -AsSecureString Import-CSV "C:\FilePath.csv" | ForEach {New-MailUser -Name $_.DisplayName -FirstName $_.FirstName -LastName $_.LastName -ExternalEmailAddress $_.EMailAddress -UserPrincipalName $_.UPN -Password $Pass}Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 9th, 2009 6:18pm

New-MailUser is used to create new mail-enabled user, since the user objects have already been created, we shall use Enable-MailUser cmdlet. I have verified the cmdlet in the lab Import-CSV "C:\FilePath.csv" | ForEach {Enable-MailUser Identity $_.displayname ExternalEmailAddress $_. EMailAddress} Notes: If you get error Cannot bind argument to parameter 'ExternalEmailAddress' beca use it is null, please ignore it and try the cmdlet again
June 10th, 2009 7:14am

Oh, yes. I missed that in question. Thanks James... :)Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2009 7:20am

Hi, The command worked perfect ! Thanks for your help.
June 10th, 2009 5:29pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics