need assistance with powershell script

hello, can someone provide a powershell script that will notify an administrator when a user reaches their warning level [mailbox size]

we prefer not to use a HT rule and have a powershell script run daily to detect any users that have reached their warning level and email an admin account.

thx in advance.

S.
siber1Asked:
Who is Participating?
 
SubsunCommented:
Try this.. the script will collect all mailbox details which has StorageLimitStatus matches IssueWarning, ProhibitSend and MailboxDisabled, export the result to a csv file. Then mail the csv file to admin.
$File = "C:\temp\report.csv"
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | 
    ? {$_.StorageLimitStatus -match 'IssueWarning|ProhibitSend|MailboxDisabled'} | 
        Select DisplayName,ItemCount,TotalItemSize,StorageLimitStatus,LastLogonTime |
        Export-Csv $File -nti

Send-MailMessage -From Admin@domain.com -To Admin@domain.com -Attachments $File -Body "Attached the mailbox details which are above warning limit" -Subject "Mailbox details which are above warning limit" -SmtpServer smtp.domain.com

Open in new window

The script is not tested, let me know if you see any issues..
0
 
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
If you enable the quota warning in Exchange, users will get warning only once a day when Exchange maintenance job is run.  Just ensure to not enable send and receive restrictions.  This way you don't need to enable any additional scripts or rules.
0
 
siber1Author Commented:
brilliant Subsun. thanks much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.