Link to home
Start Free TrialLog in
Avatar of techdrive
techdriveFlag for United States of America

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
}
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of techdrive

ASKER

thanks
If you don't have any further queries then do not forget to close the question... :-)