The problem of garbled codes in mailboxes after batch activation
Step 1: please copy the following into a notepad and save the file as a bulk.ps1 file. Please note that this file has a .ps1 extension
$list=Get-Mailbox
ForEach ($item in $list)
{
$user=Get-User $item
$sam=$user.SAMAccountName
Set-Mailbox $item-Alias "$sam"
}
Step 2: save the bulk.ps1 file to the local C:\ root directory of Exchange 2010. Then open Exchange Management Shell:
Enter:
C:\ bulk.ps1
And then return to the car.
After completing the above steps, you should see that the aliases of all users' mailboxes have been changed to login names.
Note: $list=Get-Mailbox represents the mailbox variable.
$item represents the property variables for each mailbox.
$sam=$user.SAMAccountName represents the login name variable for each user
You can see that I have finished enabling 200 user mailboxes at a time using Exchange 2010 EMC
You can see that the column of aliases in the user's mailbox is all garbled.
Execute the bulk.ps1 file saved on disk C in EMS