List Inactive Mailboxes on Exchange 2007/2010/2013.

Objective:

The script to get list of inactive mailboxes. Inactive is very relative term. For Example, some organizations mark the mailbox as inactive, if it is not accessed for a long time. Other organizations mark the mailbox as inactive, if the user did not sent email for a long period. If you ask me, why they should go by sent item. Some of the reasons could be, the mailboxes are scanned by AV/management tool that changes logon date. So they cannot go by access date. The script identify the inactive mailboxes based on Sent Items.

 

Features:

 

-       The script includes the function to help the users to run the friendly command: Get-InActiveMailbox.

- It can be used with Server,IdleDays,FilePath,Database,EmailID,HUBServer parameters.

- IdleDays Parameter is mandatory and with the range 1 – 5000.

- FilePath,Database,EmailID,HUBServer and Server parameters are optional.

- If the FilePath is not given, the output will be stored in current folder. If the Server is not used, it will run against all the mailboxes.

- You cannot use Server and Database parameters together.

- If you wish to have the output file sent thru email. You can use EmailID parameter. The EmailID should be used with HUBServer parameter.

- You cannot use administrator email ID or credential to send email. When you use other user's email id to send message, You should have at least "Send As" permission.

- If the email option used, you will be prompted with credential. Only after successful authentication, the email will be sent.

- Script does not make any modification, apart from running Get-Mailbox and Get-MailboxFolderStatistics commands.

- The output will be stored to the file with the name < IdleDays > DayInactiveMailbox.csv.

 

You can download the script from ,

https://gallery.technet.microsoft.com/scriptcenter/List-Inactive-Mailboxes-on-1ac82ddf

 

Sample Screen-Shots:

Note : The output may include system mailboxes. If you wish to process further with output, make sure you do not distrub/disable/delete system mailboxes.Refer https://technet.microsoft.com/en-us/library/gg588318(v=exchg.141).aspx for more details.

Comments

  • Anonymous
    October 07, 2013
    Thanks for the script.I am geting most of the data in the output file but while the script is progress i am getting some error as shown below. I am receiving the output file which includes some blank rows as well with date coloumns only filled . Add-Member : Cannot bind argument to parameter 'InputObject' because it is null. At C:Usersdjsatpathy-gcsadminDesktopinactivemailboxesInActiveMBX.PS1:131 char:20
  •         add-member -input <<<<  $FS -membertype noteproperty -Name "When Was Email Sent(Days)" -value "Never Sent Ema il/New Mailbox" -ea silentlycontinue    + CategoryInfo          : InvalidData: (:) [Add-Member], ParameterBindingValidationException    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCo   mmand Do you have any idea if i have missed anything ?
  • Anonymous
    October 15, 2013
    When the user never logged on mailbox, or not sent any email, it is expected. It is fine to ignore.

  • Anonymous
    January 22, 2015
    script completes, but get-inactivemailbox doesn't work

  • Anonymous
    May 11, 2015
    PZ, I had the same issue. I ran "Import-Module ." and then the get-inactivemailbox worked. Thought I'd pass that along for anybody else having trouble.

  • Anonymous
    June 03, 2015
    The comment has been removed

  • Anonymous
    October 12, 2015
    InActiveMBX.PS1 script completes, but get-inactivemailbox does not work.... how to import-module

  • Anonymous
    October 27, 2015
    i got same problem as Prathap, no error in unchanged script but The term 'Get-InActiveMailbox' is not recognized as the name of a cmdlet, function, script file, or operable program.

  • Anonymous
    January 22, 2016
    [PS] D:Scripts>Import-Module .InActiveMBX.PS1
    [PS] D:Scripts>Get-InactiveMailbox -Idledays 90

  • Anonymous
    March 17, 2016
    I kept getting object no found for Get-InActiveMailbox