locked
Mailbox script - Problem getting started RRS feed

  • Question

  • Hi all, 

    I'm new to Powershell scripting. I know enough to do single line PS commands and can get decent results, but building PS scripts isn't my strong point.

    This is an outline of what I'm trying to do. I think others may find it useful as well. 

    We have many Exchange users who have massive mailboxes. What I'd like to do is send each user a monthly email run with a PS script that does the following:

    1) Runs through all mailboxes listed in a csv file (Active mail users) with Get-MailboxStatistics and creates a csv with DisplayName, TotalItemSize, ItemCount. This, I can do. 

    2) Sums up the TotalItemSize and ItemCount individually and generates an average of both mailbox size and item count. 

    3) Goes through every mailbox individually to get the TotalItemSize, ItemCount for that user. It compares it to the average and rates their mailbox.

    4) An email is generated to each user like below:

    Dear (Name Here),

    This is your monthly mailbox assessment.

    You are currently using (User Mailbox size in GB here) of space with a maximum of (Max Mailbox Quota) or (Calculated% of use).

    The average mailbox at (company Name) is (Insert average mailbox size in GB) and you are (over / under) that size. 

    (If under average) Congratulations, your mail box is lean and mean. Keep up the good work.

    (If over average) Please do what you can to delete old emails, attachments, images, etc. to clean up your email.

    (If % of use is over 100%) Your mailbox is over the quota allowed and needs to be reduced in size. Please contact (Help Desk info here) for assistance. 

    I'm sure this is doable, but my Google searches have come up dry. Does anyone have a lead on a similar script? Cheers. 

    • Moved by Bill_Stewart Monday, April 30, 2018 9:15 PM This is not "scripts on demand"
    Monday, February 19, 2018 5:47 PM

All replies

  • You must start by learning PowerShell.  The tutorial link is below.

    Please carefully review the following links to set your expectation of technical forums.

    This Forum is for Scripting Question Rather than script requests

    Script Gallery.

    Learn PowerShell  

    Script requests


    \_(ツ)_/

    Monday, February 19, 2018 6:33 PM
  • Morning,

    I'm not asking for someone to do this, I asked if anyone could point me in the direction of the above so I can do it. 

    I know there isn't a pre-existing script, but there must be scripts that can do parts of the above. If anyone can indicate where they are I would appreciate it. 

    Tuesday, February 20, 2018 12:55 PM
  • There are hundreds of scripts in the Gallery.  Many will do most of what you ask.

    Search the Gallery.


    \_(ツ)_/

    Tuesday, February 20, 2018 1:01 PM