HELP: Error when creating bulk account in Exchange 2007 Lab

KejanardKejanard Member Posts: 48 ■■□□□□□□□□
I am have created a template account with the following command:

New-Mailbox -Name _Template -UserPrincipalName [email protected] -Database "First Storage group\Mailbox Database" -OrganizationalUnit "Exchange Lab" -ResetPasswordOnNextLogon $True

I have created a CSV file to be used at the time of import with the following command:

Name,UPN,OU
Angela Barboariol,[email protected],kejanard.local\Exchaneg Lab
Mark Harrington,[email protected],kejanard.local\Exchaneg Lab
Keith Harris,[email protected],kejanard.local\Exchaneg Lab
Tony Allen,[email protected],kejanard.local\Exchaneg Lab
Isabel Martin,[email protected],kejanard.local\Exchaneg Lab

Import syntax been used:

$Template = Get-Mailbox _Template $Temp = ConvertTo-SecureString Passw0rd -asPlainText Force Import-CSV "D:\CreateUsers.csv" | ForEach-Object -Process {New-Mailbox -Name $_.Name -UserPrincipalName $_.UPN -OrganizationalUnit $_.OU -Database "First Storage Group\Mailbox Database" -Password $temp -TemplateInstance $template}

However I keep getting this error from powershell:

Get-Mailbox : A parameter cannot be found that matches argument '$null'.
At line:1 char:24
+ $Template = Get-Mailbox <<<< _Template $Temp = ConvertTo-SecureString Pass
w0rd -asPlainText Force Import-CSV "D:\CreateUsers.csv" | ForEach-Object -Proce
ss {New-Mailbox -Name $_.Name -UserPrincipalName $_.UPN -OrganizationalUnit $_.
OU -Database "First Storage Group\Mailbox Database" -Password $temp -TemplateIn
stance $template}
Kejanard
www.kejanard.net

"All human actions have one or more of these seven causes: chance, nature, compulsion, habit, reason, passion, and desire." -Aristotle
Sign In or Register to comment.