Get email notification if mailbox itemcount increases to some limit

Dear all,
I am very new to exchange powershell, we have a requirement to monitore mailbox itemcount in perticular database, we should get alert once the item count reach to configured thresold. I have come across to fantastic script HighItemFolders.ps1 (http://gallery.technet.microsoft.com/scriptcenter/42fc40d2-46a8-4e48-b15c-f0ad23357739)
but it doent help me. it will generate the export file even if there is no data available.
can somebody assist on this... we should get alert if the itemcount reach specific count else it should not send any notification.
Thanks in advance
regards,
GV

Hi Mike,
I have added $($mbxStats.ItemCount) in the script to print current count in the body:
what will be the parameter for mailboxfolderstatistics (ItemInFolder)???
$threshold = 5000
$mbxs = Get-MailboxDatabase
'database whatever' |
Get-Mailbox
foreach ($mbx in $mbxs)
    $mbxStats = Get-MailboxStatistics $mbx
    If ($mbxStats.ItemCount
-gt $threshold) {
        $body =
"ItemCount threshold reached - $($mbx.SamAccountName) - $($mbxStats.ItemCount)"
        Write-Host $body
# For console output and informational purposes only. Get rid of this line if you plan on scheduling this.
        Send-MailMessage
-To '[email protected]'
-From '[email protected]'
-Subject 'Mailbox Alert'
-Body $body -SmtpServer smtp.domain.com

Similar Messages

  • Getting email notifications using EWS streaming notifications for a shared mail box

    Hi,
    I have been trying to get email notification for a shared mailbox using EWS streaming notifications. i am unable to get the notifications. Please can any one tell me how this task can be achieved.
    -Praveen

    I would recommend you to this link
    http://blogs.msdn.com/b/emeamsgdev/archive/2013/04/16/ews-streaming-notification-sample.aspx
    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

  • Users unable to get email notifications on followed sites, or documents: System.IO.FileNotFoundException and Microsoft.SharePoint.SPSite.InitUserToken(SPRequest request) errors

    Hi Community
    I have an issue on a live SP2013 farm that is really causing me grief.  Although  I ( Farm Admin)  and my other users can follow items which are subsequently  confirmed in our respective News Feeds - 
    none of my users are are actually getting emails notifications . 
    Alerts ( did) work fine.
    I have written some PS to vew and set  the SPS-EmailOptin for each user
    $up[$upManagerAttribute].Value = $managerNTName
    # check if the email check boxes are unchecked '1' then if so check all
    write-host -fore white "User Profile for user"$NTName "Now has email opt in currently set to" $up[$upEmailOptin].Value
    if ($up[$upEmailOptin].Value -gt 0)
    $up[$upEmailOptin].Value = 0
    write-host -fore white "User Profile for user"$NTName "Now has email opt in all checked."
    Very few are unchecked. $up["SPS-PrivacyActivity"].Value = 4095  is set for all users as in
    the the privacy settings on the newsfeed are all checked
    For my currrent client I  set up a development intranet which had the seperate web apps for the main portal and mysites. Test users were able to follow documents, sites without any problems.  Before go live I was asked to accomodate a requirement
    where there is only one web application (don't ask!)  effectivley http://myintranet 
    so mysites sits under http://myintranet/mysites .   I  made the appropriate changes to my AutoSPInstaller scritpt and al appearedd l good : services , Service appplications, mysites are all started.  I am using
    the two app pool accounts  one for the portal and one for mysites.
    A quick look at the the releated threads on this forum indicated permssions could be DB permissions  related tho I  am not seeing anything in ULS to strongly point to this
    $webApp = Get-SPWebApplication http://myintranet
    $webApp.GrantAccessToProcessIdentity("mydomain\SP_ProfilesAppPool")
    - checked and SPAcess Data is given to the mysites app pool accout to the portal web app .
    I am seeing some odd errors in ULS
    Ignoring the space ' critical' warning which I have flagged up to Ops and  I doubt is my real problem.  The errors I see that are related are :
    System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002), StackTrace:
    at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
    at Microsoft.Office.Server.Microfeed.MBUtilities.GetPublishedFeedListPrivate(SPWeb web, String relativeUrl)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.CreateFollowedSite(SPWeb site, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.Create(SPSite site, SPWeb existingWeb, Uri url, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.RecreateByReferencedItem(SPSite site, SPWeb web)
    at Microsoft.Office.Server.UserProfiles.FollowedContent.RefreshFollowedItem(FollowedItem item, SPS2SAppExecutionPolicy policy)
    at Microsoft.Office.Server.UserProfiles.FollowedContent.Follow(Uri url, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedContentServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeMethod(Object obj, String methodName, XmlNodeList xmlargs, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessMethod(XmlElement xe)
    and
    5b93b0ef-b1ff-437d-b674-5285be9b9395 Stack trace:
    at Microsoft.SharePoint.SPSite.InitUserToken(SPRequest request)
    at Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm farm, Guid applicationId, Guid contentDatabaseId, Guid siteId, Guid siteSubscriptionId, SPUrlZone zone, Uri requestUri, String serverRelativeUrl, Boolean hostHeaderIsSiteName, SPUserToken userToken, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, Boolean swapSchemeForPathBasedSites, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
    at Microsoft.Office.Server.UserProfiles.SPS2SAppUtility.TryOpenWeb(Uri url, SPSite& site, SPWeb& web, Boolean& inSPContext)
    at Microsoft.Office.Server.UserProfiles.SPS2SAppExecutionContext.InitializeForSite()
    at Microsoft.Office.Server.UserProfiles.SPS2SAppExecutionContext.EnsureInitialized()
    Also, I am testing with my account which does have all the mysites newsfeed options checked in the CA -> UPA ->"Manage User Profile"
    Anybody seen this whilist I follow the where those exceptions take me.
    Freelance consultant

    Hi,
    Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How do I stop getting email notifications from Apple. I have checked all of the "no" boxes. Help!

    How do I stop getting email notifications from Apple support. I have checked all the "no" boxes. Help!

    https://discussions.apple.com/docs/DOC-3661
    Message was edited by: deggie

  • Notifications ...  how do I stop getting email notifications?

    Notifications ...  how do I stop getting email notifications?  I like this site but now I get 20-50 or more notifications a day in my email.  I would rather shut that off and check back on my own now....  

    Once you've turned off notifications, you won't get new ones. But you still have to cancel the notifications you've been receiving. This thread explains how at the top: https://discussions.apple.com/static/apple/tutorial/email.html

  • Not able to get Email Notification even after did all the steps in MDS

    I have set simple Human Workflow : If new product come, then email will go to one of the user and get the approval from that user.
    For that I created 2 Entities Called Product, Product Status. I have set the Business rule like if the New product has come, then the Product status will be ' Pending for review'. And I selected one of the user in Notification Column in Business Rule Management
    Page.
    From back End, I have set the data base mail profile and updated the column MDMRootURL with 'My MDS URL' in tblsystemsetting table.
    But Still I didnt get Email Notification. What I have missed in this process. Please help me out in this regard. Thanks!

    Hi Raji,
    Have you any log information regarding this issue? If so, please post the log to us for further investigation(Right click on Database Mail, and select View Database Mail Log).
    -- list log events
    SELECT * FROM msdb.dbo.sysmail_log
    GO
    -- list error messages
    SELECT * FROM msdb.dbo.sysmail_event_log
    WHERE mailitem_id >= 1;
    Here are some good articles regarding troubleshooting database mail for your reference:
    Troubleshooting Database Mail: General steps:
    http://technet.microsoft.com/en-us/library/ms187540(v=sql.105).aspx
    Troubleshooting Database Mail:
    http://technet.microsoft.com/en-us/library/ms188663(v=sql.105).aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • I don't get email notifications when using find my iphone from another device.

    When my husband uses the app "find my iphone" to locate my where abouts, I no longer get email notifications.  He uses my user name and password.  I believe he dismantled that feature somehow.  Is that possible? 

    I think it time to change your password... or husband

  • Not Getting Email Notifications

    Hi
    I have configured ns_emails.xml as follows.
    <EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"
    EmailMimeCharset=""
    NotificationMode="EMAIL">
    <EmailAccount>
    <Name>Default</Name>
    <GeneralSettings>
    <FromName>Oracle BPM</FromName>
    <FromAddress>valid email id</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>AIA Server IP Address</SMTPHost>
    <SMTPPort>25</SMTPPort>
    </OutgoingServerSettings>
    </EmailAccount>
    </EmailAccounts>
    Also I have configured system-jazn-data.xml and user-properties.xml appropriately but still I'm not getting Email Notification.The error details are properly getting transported to Oracle WorkList Application but still the notification is not working. Kindly suggest a workaround and also the possible reasons for this.
    Best Regards,
    Chandu

    We are using Oracle AIA Exception Handling feature. In the BPEL process , we have catch branches defined. From the catch brances we are invoking AIAAsyncErrorHandlerBPELProcess.
    In case of an exception , the instance of AIAAsyncErrorHandlerBPELProcess and AIAReadJMSNotification is being created. We have configured ns_emails.xml and user_properties.xml as per the documentation.
    Kindly let us know the issue.

  • Why i dont get email notifications when someone uses my apple account to know my location through Find my Iphone?

    Why i dont get email notifications when someone uses my apple account to know my location through Find my Iphone?

    Try adding [email protected] as a VIP contact in your icloud mail app using the appleid used for icloud if using multiple accounts (i.e different itunes and icloud account).
    But seriously that happens really !? not getting emails for using icloud services with a valid appleid.

  • Don't know what happened to my iPhone 4 screen is completely black but  can still hear when I get email notifications, Siri still works, and can hear music?

    IPhone 4 screen is completely black
    can still hear when I get email notifications
    Siri still works and can hear my music
    what could have gone wrong?

    try to make a hard reset (home button +power button for 15seconds) then restore by itunes.this is called DFU mode,once you done,can only restore the device by itunes!let me know if it works

  • I was getting email notification (at my yahoo account) when my phone was located, that has stopped. I was wanting to see why. I would like the notifications to continue.

    I was getting email notifications (at my yahoo account) when my phone was located. This has stopped. Is there a way to restart the email notifications?

    If you truly change your existing Apple ID's email address to a new email address, follow these instructions: iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    If you created a whole new Apple Account because you couldn't access the old one after being hacked, you will need to contact the Apple Account Security Team. Apple ID: Contacting Apple for help with Apple ID account security

  • Can't get email notifications

    Since posting topics I still have yet to get email notifications. What gives?
    Thanks!
    Val

    Hi Val!
    There have been no responses to your most recently posted topic.
    Therefore, you will not receive any Subscription Notifications.
    Before that, you hadn't posted since 9/27/05, and that subscription would have been eliminated by this time.
    Am I not understanding your question?
    ali b

  • Is it possible to get email notifications if ONE column in "View Responses" has been updated? (as opposed to initial submission notifications)

      We are using it to track designs and one column changes "status".  If that one column is changed can we setup notifications for that?
    Currently, we are only getting email notifications when a form is initially submitted.
    Thanks,
    Nicole

    You can fetch data from multiple lists in ListViewWebpart, this can be possible through Content Query web part or Custom Web Part using visual studio but in that case you can not get the standard SharePoint funcationality for list (which is available in
    ListViewWebparts).
    No OOB filter available for multi-choice column, you also have to go with custom solution to achieve this.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Updated preferences and still getting email notifications

    Help I change my settings not to get email notifications but I still get flooded

    I have watched the video and followed instructions to the letter. I turned notifications off in a number of places, I don't follow the forum, I turned "receive email notifications" off. There are six threads in "my stuff", email notifications preferences are all set to "no".
    I am getting emails for pretty much everything. This is sad becuse there are so many I can't keep up with conversation and provide any help - too busy cleaning up the email. Please help.

  • How to get email notifications automatically

    I recently got the iphone 5 and I wanted to know how can I get my email notifications to come up automatically instead of going into my mail and refreshing it?
    Thanks in advance.

    Like I said that would depend on what email you're using.
    IOS: setting up email account http://support.apple.com/kb/HT4810?viewlocale=en_US

Maybe you are looking for

  • Hierarchy Variables in VC

    Hello, I have a question regarding using heirarchy variables from BW query in VC.  As a work around, I found a thread that saying that I can use web_api filed of the input port and integrate the web template that was created from WAD to show hierarch

  • LockBox

    Hello Experts, I need to know the bank account # where the customer payments are going to. The payment method is blank in the customer master data - however the lockbox field is populated ( table : KNB1). How do we find out the bank account # from th

  • I need help guys !! is my i pod dead?

    i accidentally jail broken my sisters i pod instead of mine now it cant turn on. so this is what happen one hour after jailbreak the battery was low. i was playing a game then it went completely black now it cant turn on at all. first i thought the b

  • Why cant i connect to wifi when i put in the correct password?

    why can't i connect to wifi when i am using the correct password to join

  • 5d mark iii resetting itself

    Hi folks, I have a 5d mark iii that is resetting itself to ISO 800 shutter 1000 f7.1 anytime I turn the camera off or it goes to sleep. Any ideas what could be wrong?