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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Subash SundharanIT Infrastructure Architect Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
siber1Author Commented:
brilliant Subsun. thanks much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.