Query to find specific mailboxes
- Hi
I need to find both disabled AD accounts which still have mailboxes and also mailboxes which don't have associated AD accounts.
Is there a script or LDAP query which can be used to find these ?
I need to find out how much free space may be freed up by removing all the mailboxes of deleted accounts and mailboxes which may still be on the system but don't have associated accounts any more.
Thanks
Answers
Apologize for missing the version
Per my research, there’s no method to query disabled mailbox size in the exchange 2003 natively. You can do it programmatically, for the question about script please use “Development” forum which would be the best place for the problem
How to programmatically get the size of mailboxes in Exchange
- Marked As Answer byJames-LuoMSFT, ModeratorMonday, November 09, 2009 8:14 AM
All Replies
- There is a script to find the disable account http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24263066.html
For disconneceted mail boxes http://loguinfo.blogspot.com/2009/08/to-find-disconnected-mailbox-in-mailbox.html
Raj- Proposed As Answer byJames-LuoMSFT, ModeratorWednesday, October 28, 2009 2:07 AM
- Here you Go
http://msexchangetips.blogspot.com/2007/06/exchange-find-disabled-accounts-with.html
You can look in below gallery to look for script to find out whitespace in database
http://gallery.technet.microsoft.com/ScriptCenter/en-us/441e4e39-30d0-405a-905d-81ed35702169
Vinod |CCNA|MCSE 2003 +Messaging|MCTS|ITIL V3|- Proposed As Answer byJames-LuoMSFT, ModeratorWednesday, October 28, 2009 2:06 AM
- Hi
Guys - thanks for your responses.
Another question - is there any way to get the sizes of the disabled account mailboxes without checking for each individual mailbox in Exchange system manager ?
This is for Exchange 2003. I realise there's probably a powershell command for 2007.
Thanks - I think yes. Sort out the mail boxes in ESM, run the clean up agent and get all the red crossed ones and then calculate the size of the mail boxes.
Raj- Proposed As Answer byJeevan Singh Negi Tuesday, November 03, 2009 11:02 AM
- Hi
Sorry - I meant get the sizes of mailboxes for disabled AD accounts - but the mailboxes are still assigned to the users. So they show still show up in ESM as normal mailboxes but they are listed in amongst all the other mailboxes. I've got an LDAP query to input into ADUC which lists all the disabled users still with mailboxes but it doesn't list the mailbox sizes in ADUC.
Just to see how much space might be freed up by deleting the users permanently rather than leaving them disabled.
Thanks Please refer the post in this thread to export the disabled users, and then use the cmdlet below to query the mailbox size
Import-csv C:\List.csv | Foreach {Get-MailBoxStatistics -Identity $_.Disableuser | Sort-Object -Descending "totalitemsize"| ft displayname,@{expression={$_.totalitemsize.value.ToKB()};width=20;label="Mailbox Size(kb)"},ItemCount -wrap}
Thanks for the reply.
Sorry but as I said in a previous response this is for Exchange 2003, not 2007
RegardsApologize for missing the version
Per my research, there’s no method to query disabled mailbox size in the exchange 2003 natively. You can do it programmatically, for the question about script please use “Development” forum which would be the best place for the problem
How to programmatically get the size of mailboxes in Exchange
- Marked As Answer byJames-LuoMSFT, ModeratorMonday, November 09, 2009 8:14 AM


