Restoring online users and mailboxes
If you remove the Exchange Online license for an online user
account, the user’s account is marked as an unlicensed account.
Exchange Online deletes mailboxes from unlicensed accounts
automatically after the grace period expires. By default, this grace
period is 30 days. If you delete a user account in the online
organization, the user account is marked as deleted but retained until
the retention period expires, which is 30 days by default.
In Office 365 Admin Center, select Users And Groups, and then Deleted Users to view deleted users, as shown in Figure 5. If the online organization has available licenses, you can restore the deleted users.
To
restore deleted user accounts, select the accounts to restore and then
tap or click Restore Users. Each user account successfully restored
will be confirmed. Account restoration will fail if there are any
naming or other conflicts. The User Principal Name must be unique
within the organization. If another user account has the same User
Principal Name, you’ll see a warning about a user name conflict. As
shown in Figure 6, you’ll then be able to edit the user name or replace the active user with the deleted user.
When you connect to Microsoft Online Services, you can get information about accounts in Windows PowerShell. Enter Get-MsolUser
to get a list of active user accounts. As shown in the following
example, the default output shows the User Principal Name, display
name, and licensing status of user accounts:
UserPrincipalName DisplayName isLicensed
----------------- ----------- ----------
[email protected] Media Cart 3 False
[email protected] William Stanek True
[email protected] Conference Room 3 False
[email protected] George Schaller True
[email protected] Conference Room 42 False
The output shows the user accounts associated with all types of
users, including the user accounts associated with room and equipment
mailboxes. Although room and equipment mailboxes don’t need to be
licensed, standard user accounts require licenses.
You can get a list of users whose accounts have been marked for deletion by entering Get-MsolUser –ReturnDeletedUsers.
Accounts marked for deletion are listed by User Principal Name, display
name, and licensing status. To restore a deleted account, use
Restore-MsolUser. The basic syntax for this command is:
Restore-MsolUser -UserPrincipalName OnlineId
where OnlineId is the User Principal Name of the account to restore:
Restore-MsolUser -UserPrincipalName [email protected]
The account restore will fail if there are any naming or other
conflicts. To resolve a name conflict, use the -NewUserPrincipalName
parameter to set a new User Principal Name for the user.
You can use New-MailboxRepairRequest to detect and repair mailbox
corruption. By default, the command attempts to repair all types of
mailbox corruption issues, including issues associated with search
folders, aggregate counts, provisioned folders, and folder views.
The basic syntax for New-MailboxRepairRequest is:
New-MailboxRepairRequest -Mailbox ExchangeID
where ExchangeID identifies the mailbox to repair, such as:
New-MailboxRepairRequest -Mailbox TonyS
New-MailboxRepairRequest -Mailbox [email protected]
New-MailboxRepairRequest -Mailbox "Tony Smith"
During the repair process, the mailbox cannot be accessed. Once
started, the detect and repair process cannot be stopped, unless you
dismount the associated database. Add the -Archive parameter to repair
the archive mailbox associated with an Exchange identifier rather than
the primary mailbox.
You also can use New-MailboxRepairRequest to examine and
repair all mailboxes in a database. As the repair process works its way
through all the mailboxes in the database, only the mailbox being
repaired is locked and inaccessible. All other mailboxes in the
database remain accessible to users.