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