Disabling the user in mailbox exchange 2016.

Each Microsoft Exchange in exchange 2016  mailbox consists of an Active Directory user account and the mailbox data stored in the Exchange mailbox database. All configuration data for a mailbox is stored in the Exchange attributes of the Active Directory user object. The mailbox database contains the mail data that's in the mailbox associated with the user account. The following figure shows the components of a mailbox.

 

 

 

Disabled and deleted mailboxes are retained in the mailbox database until the deleted mailbox retention period expires, which is 30 days by default. After the retention period expires, the mailbox is permanently deleted (also called purged). If a mailbox is deleted using the Remove-Mailbox cmdlet, it’s also retained for the duration of the retention period.

 

To disable a mailbox type the following command:

disable-mailbox -identity "Susan Sanders"

 

To get the status of all the mailbox that are either disabled or soft deleted type the follwing command

 

Get-MailboxStatistics -Database "Mailbox Server" | Where { $_.DisconnectReason -eq "SoftDeleted" -or $_.DisconnectReason -eq "Disabled" } | Format-List LegacyDN, DisplayName, MailboxGUID, DisconnectReason

Take a look at at the Mailbox guid and run the following command to mount the mailbox server of the user to a new user temporary.

New-MailboxRestoreRequest -SourceDatabase "Mailbox Server01" -SourceStoreMailbox "12d7196b-1ac6-49e3-b5b3-58909866da05" -TargetMailbox temporary