Import-CSV "C:\text.csv" | ForEach {Enable-Mailbox -Identity $_.UPN -Database “Mailbox Database 1” -Alias $_.alias | Set-Mailbox -EmailAddressPolicyEnabled $false -PrimarySmtpAddress $_.EmailAddress}
CSV File Format:
UPN | Alias | EmailAddress |
Ajay@contoso.com | Ajayk | Ajay.kakkar@contoso.com |
Alias: Alias name for the user(like:ajayk)
UPN: User logon name (like: ajayk@contoso.com)
Email Address: User email address(like: ajaykakkar@contoso.com)
Note: Alias and Email Address could be same or different as per your requirement.
No comments:
Post a Comment