Donnerstag, 18. November 2010

Powershell script to change Exchange mailbox alias

Hi all...

during a migration project I got Exchange mailbox aliases like this Lechner?Christian.
This was caused by the fact that a mailbox alias can not contain any spaces or a comma. The alias was generated by our migration tool, based on the user displayname.

I wrote a small script to change the mailbox alias to the samAccountName of the user.

foreach ($mbx in (Get-Mailbox -filter {Alias -Like '*'})) {Set-Mailbox $mbx -Alias $mbx.samaccountname}

You can save the script as changeAlias.ps1 and run it directly from the Exchange Powershell.

This is nothing special but I hope it can helps...
Chris

Keine Kommentare:

Kommentar veröffentlichen