techdrive
asked on
Powershell create account with multiple email addresses
I have this working script but what I would like to do is import multiple emails at the sametime of creating accounts. Is this posssible with what I have. Hypothetically I would have a field from the file I am impoting from with .csv with fields like below
name alias userprincipalname organizationalunit email addresses
test test test contoso.local test1@test.com, test@contoso.local
Import-CSV C:\temp\users.CSV | % {
New-Mailbox -Name $_.Name `
-Alias $_.Alias `
-UserPrincipalName $_.UserPrincipalName `
-OrganizationalUnit $_.OrganizationalUnit `
-Password $pass `
-ResetPasswordOnNextLogon $true
}
name alias userprincipalname organizationalunit email addresses
test test test contoso.local test1@test.com, test@contoso.local
Import-CSV C:\temp\users.CSV | % {
New-Mailbox -Name $_.Name `
-Alias $_.Alias `
-UserPrincipalName $_.UserPrincipalName `
-OrganizationalUnit $_.OrganizationalUnit `
-Password $pass `
-ResetPasswordOnNextLogon $true
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you don't have any further queries then do not forget to close the question... :-)
ASKER