Creating Bulk Users in Exchange 2010 using Exchange Management shell not working
Hi i have used Exchange Management shell for creating bulk users in exchnage 2007 and it worked perfectly. now i wanted to create bulk users in exchange 2010 SP1 with the same commands but error comes templateinstance not found.
i used CSV file that contains Name,FirstName,LastName,OU,UPN,Alias in Exchange 2007 and i also use the same format in Exchange 2010 SP1
i created one user tempalte101 in exchange 2007
$Template=Get-Mailbox template101
$Temp=ConvertTo-Securestring 12345678 -AsplainText -Force
Import-CSV C:\users.csv | ForEach-Object -Process {New-Mailbox -Name $_.Name -FirstName $_.FirstName -LastName $_.LastName -OrganizationalUnit $_.OU -UserPrincipalName $_.UPN -Alias $_.alias -Database "Name of database" -Password $Temp -TemplateInstance
$Template}
The above command works perfectly in exchange 2007 when i run these commands in exchange 2010 with anothet CSV file and user template102 with same format it shows error that templateinstance command not found.
I create users directly in Exchange it does not exist in Active Directory it works in exchange 2007.
Regards,
Devang Patel
June 29th, 2011 12:13pm
Hi,
The TemplateInstance
parameter is not supported in Exchange 2010. You may use any one as follows:
Import-CSV C:\users.csv | ForEach-Object -Process {New-Mailbox -Name $_.Name -FirstName $_.FirstName -LastName $_.LastName -OrganizationalUnit $_.OU -UserPrincipalName $_.UPN -Alias $_.alias -Database "Name of database" -Password $Password}
Import-CSV C:\users.csv | ForEach-Object -Process {New-Mailbox -Name $_.Name -FirstName $_.FirstName -LastName $_.LastName -OrganizationalUnit $_.OU -UserPrincipalName $_.UPN -Alias $_.alias -Database "Name of database" -Password (ConvertTo-SecureString
$_.password -AsPlainText -Force)}
Regards from www.windowsadmin.info
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2011 2:40pm
Hi
I have entered below commands with CSV file as below
Name,Fname,Lname,OU,UPN,Alias,Department
Rocky Patel,Rocky,Ppgp11,xxxx/xxxx/xxxx/xxxx/btech07,rocky.ppgp11@xxx.xx.xx,Rockyppgp11,Student
[PS] C:\Windows\system32>$Temp=ConvertTo-Securestring 12345678 -AsPlainText -Force
[PS] C:\Windows\system32>Import-Csv C:\rocky.csv | ForEach-Object -Process {New-Mailbox -Name $_.Name -FirstName $_.Fnam
e -LastName $_.Lname -OrganizationalUnit $_.OU -UserPrincipalName $_.UPN -Alias $_.Alias -Database "Database Name" -Passw
ord $Temp} | Set-User -Department $_.department
[PS] C:\Windows\system32>
The Command runs successfully but it doesnt show user rocky in btech07 OU in Active Directory. xxxx i have not mentioned because it is our domain details.
Regards,
Devang Patel
June 30th, 2011 8:40am
Hi
Are running Exchange 2010 SP1 Hosted environment.
When i try to run this in EMS i get this error message:
Cannot validate argument on parameter 'Alias'. The argument is null or empty. Supply an argument that is not null or em
pty and then try the command again.
+ CategoryInfo : InvalidData: (:) [New-Mailbox], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,New-Mailbox
My .CSV file looks like this
Import-CSV c:\temp\bulk_exch.csv | ForEach-Object -Process{New-Mailbox -Alias $_.Alias -Name $_.Name -UserPrincipalName $_.UPN -Organization $_.Organization -FirstName $_.FN -LastName $_.LN -DisplayName $_.DispName}
My .PS1 file looks like this
Alias;Name;UPN;Organization;FN;LN;DispName
test;Test Man;test.man@test.domain.com;test.domain.com;Test;Man;Test Man
Anybody has a solution for this?
Free Windows Admin Tool Kit Click here and download it now
September 26th, 2011 10:13am
On Mon, 26 Sep 2011 14:12:17 +0000, nPulz wrote:
>
>
>Hi
>
>Are running Exchange 2010 SP1 Hosted environment.
>
>When i try to run this in EMS i get this error message: Cannot validate argument on parameter 'Alias'. The argument is null or empty. Supply an argument that is not null or em
>pty and then try the command again.
> + CategoryInfo : InvalidData: (:) [New-Mailbox], ParameterBindingValidationException
> + FullyQualifiedErrorId : ParameterArgumentValidationError,New-Mailbox
>
>My .CSV file looks like this Import-CSV c:\temp\bulk_exch.csv | ForEach-Object -Process{New-Mailbox -Alias $_.Alias -Name $_.Name -UserPrincipalName $_.UPN -Organization $_.Organization -FirstName $_.FN -LastName $_.LN -DisplayName $_.DispName}My .PS1
file looks like this Alias;Name;UPN;Organization;FN;LN;DispName
>test;Test Man;test.man@test.domain.com;test.domain.com;Test;Man;Test Man
>
>Anybody has a solution for this?
Replace the semicolons in the file with commas? It isn't a Semicolon
Separated Value file that the import-csv cmdlet works with. :-)
---
Rich Matheisen
MCSE+I, Exchange MVP
--- Rich Matheisen MCSE+I, Exchange MVP
September 26th, 2011 11:45am
Sorry for the mix-up, think i was fast copy-paste the .csv and .ps1 file. They are opposite of what i posted.
And found out that Excell 2010 did save the .csv file with semicolons.
Free Windows Admin Tool Kit Click here and download it now
September 26th, 2011 11:55am