user & mailbox creation script for exchange
I have a script that i have written that will import users from a csv file I am runnign manually following command on ex management shell. I have created csv file mbinfo.csv which contains Alias,Name,UPN parag,Parag Jayant,Pjayant@xyz.com $Password=Read-Host "Enter Password" -AsSecureString [PS] C:\Windows\System32>import-csv mbinfo.csv | foreach {new-mailbox -alias $_ alias -Name $_.name -UserPrincipalName $_.UPN -Database "mailbox Database" -org Users -Password $Password} when i run this cmd, I am getting following error: New-Mailbox : Cannot bind argument to parameter 'UserPrincipalName' because it is null. i have copied above file in bulk.ps1 & run, I am getting following error. [PS] C:\Windows\System32>.\bulk.ps1 The term '.\bulk.ps1' is not recognized as a cmdlet, function, operable progra , or script file. Verify the term and try again. At line:1 char:10 + .\bulk.ps1 <<<<. when i run import -csv mbino.csv, result is Alias Name UPN ----- ---- --- parag Parag Jayant Pjayant@xyz.com Kindly advise.
February 7th, 2010 4:51pm

I'd check that .csv and make sure there's no trailing whitespace in the UPN column heading.
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2010 8:19pm

I can create the mailbox by using the script you provided above, as mjolinor said, please double check your csv fileJames Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
February 16th, 2010 10:15am

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

Other recent topics Other recent topics