locked
Exchange 2007 EMS Script for hidden mailboxes RRS feed

  • Question

  • Hi

    Can anybody provide me with an EMS script to do the following:

    1. Find all hidden & disabled mailboxes in a storage group

    Regards

    Wednesday, July 4, 2012 11:47 AM

Answers

  • Yes, below are the extensions to get the mailbox size as well

    Hidden:

    Get-MailboxDatabase -Storagegroup <SGNAME> | Get-Mailbox -Resultsize unlimited  | where {$_.HiddenFromAddressListsEnabled -eq $true} | Get-MailboxStatistics | select DisplayName,Database,TotalItemSize

    Disabled:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database,TotalItemSize

    To show the size in KB or MB using the expression as shown in below example:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database,@{expression={$_.TotalItemSize.Value.ToKB()}}

    • Edited by Rajitha Chimmani Sunday, July 8, 2012 1:27 PM Added more details
    • Proposed as answer by Terence Yu Monday, July 9, 2012 7:11 AM
    • Marked as answer by Terence Yu Monday, July 16, 2012 12:58 AM
    Sunday, July 8, 2012 1:20 PM
  • Mailboxes are under databases. So you will have to specify for the database.

    Hidden:

    Get-MailboxDatabase -Storagegroup <SGNAME> | Get-Mailbox -Resultsize unlimited  | where {$_.HiddenFromAddressListsEnabled -eq $true} | select DisplayName,Database

    Disabled:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database

    • Proposed as answer by Terence Yu Thursday, July 5, 2012 2:24 AM
    • Marked as answer by Terence Yu Monday, July 16, 2012 12:58 AM
    Wednesday, July 4, 2012 12:07 PM

All replies

  • Mailboxes are under databases. So you will have to specify for the database.

    Hidden:

    Get-MailboxDatabase -Storagegroup <SGNAME> | Get-Mailbox -Resultsize unlimited  | where {$_.HiddenFromAddressListsEnabled -eq $true} | select DisplayName,Database

    Disabled:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database

    • Proposed as answer by Terence Yu Thursday, July 5, 2012 2:24 AM
    • Marked as answer by Terence Yu Monday, July 16, 2012 12:58 AM
    Wednesday, July 4, 2012 12:07 PM
  • Hi
       If post is helpful to your issue, please mark the case.

    Terence Yu

    TechNet Community Support

    Friday, July 6, 2012 2:39 AM
  • Thanks very useful is there a way to pipe to actual size of the hidden or disabled mailbox
    Sunday, July 8, 2012 6:41 AM
  • Yes, below are the extensions to get the mailbox size as well

    Hidden:

    Get-MailboxDatabase -Storagegroup <SGNAME> | Get-Mailbox -Resultsize unlimited  | where {$_.HiddenFromAddressListsEnabled -eq $true} | Get-MailboxStatistics | select DisplayName,Database,TotalItemSize

    Disabled:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database,TotalItemSize

    To show the size in KB or MB using the expression as shown in below example:

    Get-MailboxDatabase -StorageGroup <SGName> | Get-Mailboxstatistics | where{$_.Disconnectdate -ne $null} | Select DisplayName,Database,@{expression={$_.TotalItemSize.Value.ToKB()}}

    • Edited by Rajitha Chimmani Sunday, July 8, 2012 1:27 PM Added more details
    • Proposed as answer by Terence Yu Monday, July 9, 2012 7:11 AM
    • Marked as answer by Terence Yu Monday, July 16, 2012 12:58 AM
    Sunday, July 8, 2012 1:20 PM
  • Hi
       Do you have anything update on your issue ?

    Terence Yu

    TechNet Community Support

    Tuesday, July 10, 2012 2:19 AM