Batch new-mailbox script issue

Hi there. Could you please help me with an issue I am having, I have used this batch mailbox script many times before but it has suddenly decided to stop working it appears to run but does not create any mailboxes and does not give any error messages at all. Am I missing something blindingly obvious?

$c = Get-Credential

Import-CSV Test.csv | foreach {New-Mailbox -SamAccountName $_.samaccountname -Name $_.name -UserPrincipalName $_.UPN -Database Tenant -OrganizationalUnit 'domain.com.au/Tenant' -AddressBookPolicy 'Tenant' -Password $c.password -ResetPasswordOnNextLogon $false}

I tried a similar script from technet which is pretty much the same as mine

$c = Get-Credential

$users = Import-CSV "C:\Test.csv" 

$users| foreach

{

New-Mailbox -SamAccountName $_.samaccountname -Name $_.name -UserPrincipalName $_.UPN -Database Tenant -OrganizationalUnit 'domain.com.au/BC ESP/TEST' -AddressBookPolicy 'Tenant' -Password $c.password -ResetPasswordOnNextLogon $false

}

Although when I run this one I get the following message

Process[0]:

Any help would be hugely appreciated.

Thanks

  • Edited by itsgold 9 hours 3 minutes ago
December 9th, 2013 7:34pm

Hi

Are you running this from powershell or the exchange management shell?

Free Windows Admin Tool Kit Click here and download it now
December 10th, 2013 12:29am

Exchange Management Shell
December 10th, 2013 12:34am

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

Other recent topics Other recent topics