Home > Exchange, Exchange 2010, Microsoft, PowerShell, Scripts > Changing the Exchange Alias to be the sAMAccountName – PowerShell Script

Changing the Exchange Alias to be the sAMAccountName – PowerShell Script


Run the following (after testing)

$list=get-mailbox -ResultSize Unlimited

foreach($item in $list)

{

$user=get-user $item

$sam=$user.SAMAccountName

Set-Mailbox $item -alias “$sam” -ea silentlycontinue

}

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: