I want to identify what exchange mailboxes are associated with users who are disabled in AD or no longer exist in AD. The environment is 2003 domain with 2007 exchange. thanks
ExchangeWindows Server 2003
Last Comment
Mohammed Khawaja
8/22/2022 - Mon
Will Szymkowski
From the Exchange Management Shell run the following command...
You could also run the command listed below to list you disabled accounts in Active Directory
dsquery user -disabled -limit 0 > disabled-users.txt
I believe the script provided by Will will not work if you do not have AD Web Services which is available if you have Win2K8 or higher DCs.
Will Szymkowski
@Mohammed - you might be correct but I have not tested this scenario within the Exchange Management Shell. However the command you have provided will get all AD users regardless if the user has a mailbox or not. The original question is regarding mailboxes where the AD Account is disabled.
I have tried to run the import-module activedirectory but receive the error it was not loaded because a valid a valid module file was not found in any module directory. Just to confirm I am running this command on exchange powershell thanks.
Open in new window
Will.