Disabling AD Account and have Exchange Mailbox disabled, is this possible????

Copper Contributor

Hey,

 

We are currently a hybrid environment, On-Prem Exchange 2016 with Office 365 for App usage. We are planning on going full 365 in the future, but this is our current run. 

 

Is there a way that when you disable a user account in Active Directory for it to disable the mailbox on exchange, or delete it? 

 

I know that you can delete the mailbox and it deletes the user in AD, but for some reason it won't work the other way. 

 

Our practice is not to delete an account for a period of time, only disable it. Currently we have to go into EAC, disable all the access and options, and the mailbox sticks around. This works, but it would be great to be able to disable an AD account and have all groups/distributions they are associated with be disabled until we decide to delete it. 

 

I spoke with MSFT and they talked about a GPO on the Exchange server, but even that doesn't seem to get triggered by the AD account being disabled. They said there may be a script that can run, but I'm not having a lot of luck there. Hoping someone else has come across this issue or though process before and found a solution.


Thank you! 

1 Reply

@Richochet_Rabbit 

Hi,

When you disable a mailbox, all Exchange attributes are removed from the associated user account in Active Directory.
The disconnected mailbox is hidden and marked for removal.
The disconnected mailbox is permanently deleted (purged) based on the MailboxRetention property value for the mailbox database (the default value is 30 days)

 

Disable-Mailbox "AliasName"

 

Please see below link, If you want to run the script against all Disabled users (Active Directory)..

 

Do not run this script in your production environment directly, first test in your LAB.
https://www.thatlazyadmin.com/bulk-disable-exchange-mailboxes/ 

 

Regards,
MD