Exchange 2010 PowerShell Script to gather all Disabled Mailboxes/Users

Hi, we have a Exchange 2010 env't and I would like to know what command to run which will output all my users whose Exchange Mailboxes are disabled.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AmitIT ArchitectCommented:
Here is the command. Refer:

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisconnectReason -eq "Disabled" } | ft DisplayName,Database,DisconnectDate
Will SzymkowskiSenior Solution ArchitectCommented:
Use the following command...
Get-MailboxStatistics -Server "MailboxServerName" | ? {$_.DisconnectReason -eq "Disable"} | 
select DisplayName, DisconnectDate, DisconnectReason | 
Export-csv "c:\DisabledMailboxes.csv" -nti

Open in new window

This will export the results to a CSV file.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vincent BurtonCommented:
You may try this Get-MailboxReport.ps1 – PowerShell Script to Generate Mailbox Reports:

Managing Disconnected Exchange Mailboxes with PowerShell:

Here I found and another informative article about the Microsoft Active Directory Windows PowerShell cmdlets, and use them to find active and disabled users:

Get the list of the disconnected mailboxes:

Get-MailboxStatistics -Server <server> | where { $_.DisconnectDate -ne $null } | select DisplayName,DisconnectDate

Replace <server> with your mailbox server.

Try this:  Get-Mailbox |?{$_.UserAccountControl -Match "AccountDisabled"}| Fl Name,Database,UserAccountControl

Hope it helps you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.