Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / September 2006

Tip: Looking for answers? Try searching our database.

Event sink script file gets false email notifications

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
salmaanali@hotmail.com - 13 Sep 2006 15:04 GMT
We have a departmental public folders and a sink script that informs
all the users in that department when there is a new message in the
public folder.  The script that is triggered when a new mail
notification come through looks like this:

Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, lFlags)
    Dim aBRL, aUser
    Dim i
    Dim oShell
    Dim sMBox, sMessage

    Call LogEvent("ExStoreEvents_OnSave","Begin")

    ' a new item has been saved in a public folder, so send out an alert
to all
    ' administrators and ISCs at this location

    ' parse the url to find out what mailbox/folder caused the event
    aBRL = Split(bstrURLItem,"/")
    sMBox = aURL(UBound(aURL)-1)
    Call LogEvent("ExStoreEvents_OnSave","PFolder=" & sMBox)
    Call LogEvent("ExStoreEvents_OnSave","Message=" & aURL(UBound(aURL)))

    ' grab the array of users
    aUser = RetrieveUsersForMBox(sMBox)

    ' create a command shell to send the net send
    Set oShell = CreateObject("WScript.Shell")

    If IsArray(aUser) Then
        ' an array of users was passed back, so net send them that they have
mail
        sMessage = Replace(S_MAIL_ALERT,"<MBox>",sMBox)
        sMessage = Replace(sMessage,"<vbCR>",vbCR)
        For i = 0 To UBound(aUser)
            'WScript.Echo("net send " & aUser(i) & ": " & sMessage)
            Call oShell.Run("net send " & aUser(i) & " " & sMessage)
            Call LogEvent("ExStoreEvents_OnSave","Notify=" & aUser(i))
        Next
    Else
        ' no user is set up for this location, so net send to the sys admin
        sMessage = Replace(S_MAIL_NO_ADMIN,"<MBox>",sMBox)
        sMessage = Replace(sMessage,"<vbCR>",vbCR)
        Call oShell.Run("net send " & S_ADMIN_ALERT_USER & " " & sMessage)
        Call LogEvent("ExStoreEvents_OnSave","NoUsers:Notify=" &
S_ADMIN_ALERT_USER)
    End If

    Set oShell = Nothing
    Call LogEvent("ExStoreEvents_OnSave","End")
    Call LogEvent("","")

End Sub

Lately I have noticed that the aforementioned script gets triggered all
the time without any new email message in the public folder.  Its
driving all of us users crazy...Pleeeeeeeeeeeeeeeease help!!!!!!!!!!!!!1
Henning Krause - 19 Sep 2006 21:44 GMT
Hello,

the OnSave event is triggered if any changes are made to an item.

You should filter to those events where the EVT_IS_DELIVERED (value is 8)
flag is set in the lFlags parameter. Or at least EVT_NEW_ITEM (value is 1).

Best regards,
Henning Krause

----------------------------------------------------------------------------
Visit my website: http://www.infinitec.de
Exchange access library  -
http://www.infinitec.de/software/nettoolbox/infinitec.exchange.aspx

> We have a departmental public folders and a sink script that informs
> all the users in that department when there is a new message in the
[quoted text clipped - 53 lines]
> the time without any new email message in the public folder.  Its
> driving all of us users crazy...Pleeeeeeeeeeeeeeeease help!!!!!!!!!!!!!1
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.