Hi @Sanjay
By default, the retention period of disabled mailboxes on each database in Exchange 2013 is 30 days.
It means disabled mailboxes which are older than 30 days will be removed automatically.
If you have changed the default setting and would like to manually delete the disabled mailboxes which are 90 days older.
You may use this command to first list all these disable mailboxes:
Get-MailboxDatabase | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq "Disabled"} | where {$_.DisconnectDate -le (get-date).adddays(-90)} | fl DisplayName,Database,DisconnectDate
And run this command to remove the disabled mailboxes:
Get-MailboxDatabase | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq "Disabled"} | where {$_.DisconnectDate -le (get-date).adddays(-90)} | ForEach {Remove-StoreMailbox –Database $_.database –identity $_.mailboxguid –MailboxState Disabled}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.