Link to home
Start Free TrialLog in
Avatar of rjdennis
rjdennisFlag for United States of America

asked on

SharePoint sends initial alert but doesn't send update alerts

I've finally got outgoing email working on MOSS 2007!

The problem I have now is that when I create a new alert, I get the initial "You have successfully created an alert for [alertname]", but I don't get any alerts afterwards.  

I've tried modifying tasks, deleting them, etc, to try to trigger an alert, but nothing.

I've done some searches and I've seen similar issues, but I'm not finding a resolution...

My event viewer doesn't show any event errors when I do so, and when use Wireshark I see literally NO activity when the alerts are triggered.  Obviously when the initial alert is created, Wireshark shows me a slew of things and I get the email very shortly after.  

Any ideas?
Avatar of bikramraut
bikramraut
Flag of India image


RESOLUTION:
============
1. Opened the MOSS Central Administration page, clicked on Operations--Timer Job
Status, made sure the following two jobs were showing "success" and 100%
Change Log
Immediate Alerts

2. Opened the command window, navigated to the BIN folder and got the property of
Alerts-enabled to make sure the alerts are enabled for the timer service:
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url <http://problemsite> -pn
alerts-enabled
The expected output is
<Property Exist="Yes" Value="yes" />

3. Made sure the account running the SharePoint Timer service is the account which
has the administrator Full Control permission over the site and the full permission
over the content database. Then we restarted the timer service.

4. We found EventData and ACL are not NULL for the specific content database. This
seems to be the key to the problem.

5. We checked the property job-immediate-alerts schedule
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url <<http://ProblemSite>> -pn
job-immediate-alerts
it showed Property Exist="No" for that specific site.

6. We used the following command to re-set the schedule
stsadm.exe -o setproperty -url <<http://ProblemSite>> -pn job-immediate-alerts -pv
"every 5 minutes between 0 and 59"

Alerts began to work.


ADDITIONAL INFORMATION
=========================
The internal working mechanism of how an alert should work in v3:
1. The EventCache table records the SQL level events as they occur and the
EventData and ACL columns are not NULL for an alert event.
2. There is an alerts timer job that runs periodically to process the records in
the EventCache. After the alerts timer job runs, it nulls out the EventData and
ACL columns.
3. Then, it will log an event into the EventLog table.


MORE TROUBLE SHOOTIING STEPS
=============================
1. Open the command window, go to the BIN folder and get the property of
Alerts-enabled to make sure the alerts are enabled for the timer service:
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url <http://problemsite> -pn
alerts-enabled
The expected output is
<Property Exist="Yes" Value="yes" />

2. Open the MOSS Central Administration page, click Operations--Timer Job Status,
make sure the following two jobs are showing "success" and 100%
Change Log
Immediate Alerts

3. Make sure the account running the SharePoint Timer service is the account which
has the administrator Full Control permission over the site and the full permission
over the content database. Restart the timer service if required.

4. Open SQL Query Analyzer, connect to the content database of problematic site.
Run the following query and copy the result out.
Select * from timerlock
Let me know the server name seen in the LockedBy column is the same one of this SPS
server. This server is responsible for processing the timer service.

If the issue persists, collect the following information:
1. Run the following query against the content database of problematic site
select * from eventcache where EventData is not null
This will out put all fo the subscritions which have not been processed yet. We can
see if there are some alerts which are not processed. Export the result to us.

2. select * from eventlog where ListID = 'xxx'
Export the result to us.
You can get the ListID from the EventCache table by running
Select * from EventCache and check the documents which correspond to the
problematic list.

3. If you cannot find any record in the step 1, please perform the following
tests: Put filemon on the SPS server and we can see if the Timer service picks up
the alert template during the whole process.
a. Upload a new document to the document library which is supposed to have the
alerts. Begin running the filemon.
b. Run
select * from eventcache order by EventTime DESC
Check if the latest log is the one corresponds to your uploaded document. Make sure
the EventData and ACL columns are not NULL.
c. After 5 minutes or more minutes, check the EventCache table again to see if the
EventData and ACL columns are NULLed.
d. If so, stop filemon after the EventData and ACL columns are NULLed . Send the log to us.
Avatar of rjdennis

ASKER

bikramraut,
I went through your whole Resolution list, and everything looks good on my end for the most part.
-Change Log and Immediate Alerts are both successful and 100% on the CA>Operations>Timer Job Status page.  
-<Property Exist="Yes" Value="yes" /> was the response I got to the STSADM command "C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\BIN>stsadm.exe -o getproperty -url </" target=_blank rel=nofollow>http://problemsite> -pn
alerts-enabled"
-My account is a FULL administrator
-As far as EventData and ACL, I'm not really sure where to look for those...
-"every 5 minutes between 0 and 59" was the response for the 2nd STSADM command you mentioned...
I tried triggering an alert after verifying the above steps, but I did not receive an alert...
When you mention all of the things I can check on the database, where do I go to check these?  I'm not very technical when it comes to databases, Im using SQL Server 2005 and the Management Studio on my DB server..Where should I go to check the other things?
Thanks for your help!  
Check first the SMTP configuration in CA.

The SMTP configuration in CA is setup for the SP server (servername.domain.com) and then I have IIS SMTP configured to forward to an outbound mailhop server hosted by Dyndns.org, from there the messages are sent to our business email addresses which are hosted by Yahoo.  
I do receive the initial alert when I create a new alert, just not the alerts for when something is created, changed, deleted, etc.  
Follow The attached file to Resolve It
============================
In order to access the table in the database
you need to open management studio and connect to the instance  then explore the content database of the site

under the content database you will get the desired tables...

=======================================================================================
=====================================================================================



Configuring Incoming Email
WSS and Office Server are tightly integrated with email. You can configure SharePoint to accept incoming email and drop the email in a specific discussion board. Before you configure incoming email on a server, ensure that you have SMTP running locally on the server. To configure incoming email, do the following:
1.      Launch SharePoint Central Administration.
2.      Click the Operations tab.
3.      Click Incoming e-mail settings under the Topology and Services section.
The following sections host several settings on this page:
"      Enable Incoming E-Mail
"      Directory Management Service
"      Safe E-Mail Servers
"      E-Mail Drop Folder
"      Incoming E-Mail Server Display Address
Enable Incoming E-Mail
In this section, you have the following settings:
Setting      Description
Enable sites on this server to receive e-mail      Allows you to select Yes or No to confirm if you want the server to receive e-mail. If you select Yes, ensure you have the SMTP service running on the server.
Settings mode      Allows you to specify Automatic or Advanced. Automatic sets the Safe E-Mail Servers, E-Mail Drop Folder, and Incoming E-Mail Server Display Address. Advanced allows you to specify custom values for Safe E-Mail Servers, E-Mail Drop Folder, and Incoming E-Mail Server Display Address.

Directory Management Service
Directory Management Service is a service that allows you to email enable a site. An email enabled site refers to a SharePoint site that can receive email and archive the emails to a discussion board. The service provides a consistent site creation experience between Office Server and WSS and allows site administrators to:
Ï      Create a contact for a SharePoint discussion board so emails sent to that contact can be archived to the discussion board.
Ï      Create a new email distribution list [DL] for a SharePoint group so emails can be used to communicate between the members of that group and possibly also archived to a respective discussion board.
Ï      Modify or delete discussion board contacts and SharePoint group DLs can be modified or deleted through SharePoint.
Ï      Approve or reject distribution list requests in SharePoint.
Ï      Edit and delete approved distribution lists in SharePoint.
Ï      Collect Site Directory metadata about a new site during provisioning.
For information on Directory Management Service, refer to the 6277  Windows SharePoint Services (WSS) 2007 Core Services course.
In this section, you have the following settings:
Setting      Description
Connect to a SharePoint Directory Management Service      Allows you to select Yes or No to confirm if you want the server to connect to and use the directory management service. Selecting Yes will enable the below settings.
Directory Management Service URL      Enables to you to specify the URL, such as http://server/_vti_bin/SharePointEmailWS.asmx, to locate where the service is running currently.
E-mail server address      Gathers information about the FQDN of the e-mail server.
Does this Directory Management Service manage distribution lists      Allows you to select Yes or No to confirm if the Directory Management Service you specify can manage distribution lists.
Should distribution lists accept mail only from authenticated senders      Allows you to select Yes or No to confirm if the Directory Management Service you specify can accept mail only from authenticated senders.

Note: The Directory Management Service is covered elaborately in the 6277  Windows SharePoint Services (WSS) 2007 Core Services course.  
Safe E-Mail Servers
This setting helps ensure the authenticity of e-mail stored in SharePoint by restricting the set of e-mail servers that can route email directly to WSS. In this section, you have the following settings:
Setting      Description
Accept mail from all e-mail servers      Enables email from all email servers to be received and processed. This is the default setting.
Accept mail from these safe e-mail servers      Allows you to provide a list of email servers that can be considered safe.
E-Mail Drop Folder
The email drop folder refers to the folder in the server file system where the Simple Mail Transfer Protocol (SMTP) drops email. The following figure shows a sample folder structure where the mails are dropped:
 
If you have multiple SMTP virtual servers, you will need to specify the email drop folder from where SharePoint will need to pickup the emails. A service, SharePoint Timer Service (SPTimerv3), is responsible for checking the drop folder frequently and updates the discussion boards with the emails received.
 
If you have multiple Web servers running the incoming email service in a load balanced configuration, you will need to ensure that the drop folder path specified is consistent in all servers in the farm.
Incoming E-Mail Server Display Address
You specify the email server address that will be displayed in Web pages to users when they create an incoming e-mail address for a site, list, or group. This setting is often used in conjunction with the Microsoft SharePoint Directory Management Web Service to provide a more friendly e-mail server address for users to type.


Disk Quota Warning      Checks if sites exceed quota limits and sends email alerts to owners if true
E-Mail Enabled Lists      Checks the SMTP drop folder periodically, picks any emails received, and drops the emails in discussion boards and other lists
Immediate Alerts      Sends email alerts to users


Configure Web Application Settings
After creating a Web application, you can configure its settings by doing the following:
1.      Launch SharePoint Central Administration.
2.      Click the Application Management tab.
3.      Click Web application settings under the SharePoint Web Application Management section. The Web Application Settings page is displayed.

 

Alerts      Specify the default settings for e-mail alerts on this virtual server. You can specify to enable alerts and the maximum number of alerts a user can create. By default, alerts are turned on and users are limited to create 500 alerts.








Before you configure automatic site deletion, ensure you have the outgoing email settings configured. All settings that enable automatic site deletion will otherwise be disabled. You can configure automatic deletion from SharePoint Central Administration by doing the following:
1.      Launch SharePoint Central Administration.
2.      Click the Application Management tab.
3.      Click Site use confirmation and deletion under the SharePoint Site Management section. The Site Use Confirmation and Deletion page is displayed.

 

Confirmation and Automatic Deletion Settings      Specify whether site owners must confirm that their site collection is still in use, and how frequently to send email confirmation notifications. You can enable the following options:
1.      Send e-mail notifications to owners of unused site collections: This option allows you to send notification alerts after a specified number of days a site is created. You can also configure SharePoint to check for unused sites periodically. The SPTimer service then performs the task of checking the sites and sending alerts.
2.      Automatically delete the site collection if use is not confirmed: This option works only if email notifications are enabled. SharePoint automatically deletes sites after the number of alerts sent reaches the threshold you specify.






To specify user rights for Web applications, do the following:
1.      Open the Application Management section of SharePoint Central Administration.
2.      Click User rights for Web application under the Application Security section. The User Rights for Web Application page is displayed.


E-mail is the traditional method that people use to collaborate on projects and is still the preferred method of information dissemination in an enterprise. The main advantage of e-mail is that it is cheap, fast, and complete (everyone gets e-mail today). SharePoint has a very complete approach to e-mail alerting when it comes to changes in site content (Office Server also includes the ability to be alerted when search results change).
Lesson Objective
After completing this lesson you will be able to:
Ï      Describe the e-mail alerting features of WSS.
Ï      Describe the process of creating alerts.
Ï      Describe the process of managing alerts.
Ï      Describe the location and use of the alerts web service.
Ï      Describe the database structures that support e-mail alerts.
Creating Alerts
The process of creating an alert for the end user is quite simple. The alerting system is exposed in the SharePoint site via links labeled Alert Me on the Action menu. The user then selects the circumstances under which and the interval for the alerts to be delivered. There are quite a few options that allow for a variety of alerting scenarios.
 
There are some new options when it comes to the circumstances that generate an alert.
 
There are two elements to these circumstances. The first is the type of change that will generate the alert:
Ï      All changes
Ï      New items are added
Ï      Existing items are modified
Ï      Items are deleted
Previous versions of SharePoint did not allow for further filtering of alert results. New for WSS V3 is the ability to create a filter to be even more specific so that items the user changes do not generate alerts. You can also limit the alerts to items created by or modified by the user. Additionally you can filter an alert that would appear in a particular view of the list (i.e. Only alert me when one of My Tasks changes).
The final option in creating an alert allows the user to choose the frequency (assuming some change) that alerts will be sent.
 
The options are to create an immediate alert which are sent at most every 5 minutes (when the timer service runs) or a digest alert which can either be sent daily at a specific time or weekly on a specific day and time.
If you have not set your e-mail address and attempt to create an alert you will see the following error:
 
Once the alert is created an e-mail is sent acknowledging the creation of the alert. This is used by Microsoft Outlook® in order to add the SharePoint site to their list of alert providers. The e-mail is sent from the configured WSS site account. After that, changes that match the filter will generate alerts on the schedule specified.
Note that if this is the last alert the user is allowed to create before their quota is reached, the following warning is included at the bottom of the mail:

Your alerts quota is full. You cannot create additional alerts on this website.
Each section in the new alert page will correspond to a .ascx file in the web. This will allow developers in SharePoint to replace shipped UI with one of their choosing without having to copy and paste HTML. In addition, each of the pieces of code-behind which handle the form submission for this page will be implemented using interfaces, and can be replaced by developers looking to extend the handling of the form submission.

Whats Under the Hood
When you create an alert the stored procedure proc_AddSubscription is run to make the database changes to add the alert. Essentially, this inserts various values into the ImmedSubscriptions or SchedSubscriptions tables in the content database. The ImmedSubscriptions table has the following columns:
Column name      Data type      Data length      Nulls allowed?
Id      uniqueidentifier      16      False
SiteId      uniqueidentifier      16      False
WebId      uniqueidentifier      16      False
ListId      uniqueidentifier      16      False
ItemId      int      4      True
EventType      int      4      False
UserId      int      4      False
UserEmail      nvarchar      255      False
SiteUrl      nvarchar      64      False
WebUrl      nvarchar      256      False
WebTitle      nvarchar      255      True
WebLanguage      int      4      False
WebLocale      int      4      False
WebTimeZone      smallint      2      False
WebTime24      bit      1      True
WebCalendarType      smallint      2      True
WebAdjustHijriDays      smallint      2      True
ListUrl      nvarchar      256      False
ListTitle      nvarchar      255      False
ListBaseType      int      4      False
ListServerTemplate      int      4      False
AlertTitle      nvarchar      1000      True
AlertType      int      4      True
AlertTemplateId      uniqueidentifier      16      True
Filter      nvarchar      4000      True
BinaryFilter      varbinary      1024      True
Properties      ntext      4096      True
Status      tinyint      1      False
ItemDocId      uniqueidentifier      16      True
Deleted      bit      1      False

The SchedSubscriptions table adds the following columns to allow for the timing of alert delivery.
Column name      Data type      Data length      Nulls allowed?
NotifyFreq      int      4      False
NotifyTime      datetime      8      True
NotifyTimeUTC      datetime      8      True
Some key values in these tables are:
EventType      -1,4095 = All Changes
1 = New items are added
2 = Existing items are modified
4 = Items are deleted
Properties/ eventtypeindex      Also maps to eventtype as
0 = All Changes
1 = New items are added
2 = Existing items are modified
3 = Items are deleted
Properties/ filterindex      0 = Anything changes
1 = Someone else changes an announcement
2 = Someone else changes an announcement created by me
3 = Someone else changes an announcement last modified by me
4 = An announcement with an expiration date is added or changed
5 = Someone changes an item that appears in the following view
The property bag for the alert looks like this:
<miscellaneous>
    <property name="eventtypeindex" value="3" />
    <property name="siteurl" value="http://sharepoint3" />
    <property name="viewid" value="684fac55-5a38-49bb-829e-659e866b72a5" />
    <property name="filterindex" value="1" />
    <property name="mobileurl" value="http://sharepoint3/_layouts/mobile/" />
</miscellaneous>
The NotifyFreq, NotifyTime, and NotifyTimeUTC      values control the alert interval. A notify frequency of 1 is for daily alerts and 2 is weekly. Notify time denotes the next time the alert will be sent. NotifyTimeUTC is the time in Universal Coordinated Time.
Managing Alerts
There are several entry points to managing all alerts on the site and for individual users.
Managing My Alerts
From the home page you can click My Settings on the top right link area.
 
This will lead the user to the User Information page where my alerts is an option.
 
There are two other ways to get to MySubs.aspx (the My Alerts page). On any alert creation e-mail, there is a link to manage alerts.
 
The other way to access alert management is from an alert e-mail itself which provides a link to manage alert settings.
 
On the My Alerts page, the alerts are grouped by delivery frequency.
 
From this page, you can delete any alert or by clicking on the alert itself you can edit the properties of an alert. Clicking on Add Alert above will allow the creation of an alert for a list on the site.
 
Managing Alerts for All Users on a Site
Users who have the Manage Alerts right (are able to manage alerts for the entire site) can access the sitesubs.aspx page which allows access to manage settings for alerts for all users. The link to sitesubs.aspx is available as User Alerts on the site settings page under site administration.
 
This page offers a drop-down list that is a lookup to all the users on the site. It should be noted that this is a listing for only the current site and not sub-sites. By selecting a user, the view will be filtered to the alerts for that user.
 
It should be noted that this page only allows the deleting of alerts. You cannot change any of the frequency or filtering options for the users alerts.
At match time, if SharePoint finds an error (for example a field being filtered has been removed from the list schema, or the user no longer has access to the item) SharePoint performs the following actions:
1.      Send an e-mail to user Alert <title> has been deleted because of an error in alert definition. Browse to the list or item you had created the alert, and recreate the alert.
2.      Delete the alert which caused the error.
3.      If a filter option on a field caused the error, remove the filter option for the alert template, so that future alerts cannot be created in incorrect state.

Also, SharePoint sends an e-mail to the alert creator for any change in alert settings, calling out changed properties.
There will also be four kinds of events which will generate a clean-up of alerts and alert templates:

Event      Action
User is deleted from site      All alerts for the user on the site are removed. No notification is sent. SharePoint will delete alerts for which the user is a recipient, but not all alerts which they originally created.
User is removed from the ACL of an item      SharePoint checks either at the time when security changed, or when an event match occurs if the user has access. If not, SharePoint deletes the alert which caused the match to occur.
Item is deleted      All alerts for that item are deleted. SharePoint sends notifications to users that the item has been deleted. Alerts will be restored if the item is restored from the Recycle Bin.
Site/list is renamed/moved      Alerts and alert templates for the site/list are preserved.
Whats Under the Hood
In managing alerts, there are a few stored procedures and database structures worth pointing out. The procedure proc_GetWebSubscriptionsUniqueUsers is used to return a list of users that have subscriptions on the site. This is used in populating the drop-down on the site wide alert management page. This procedure takes two arguments, both the siteid and webid GUIDs need to be provided. The next stored procedure that runs is proc_GetWebSubscriptions which returns the actual subscriptions for a user when supplied the siteid, webid, and userid. This procedure performs a union on immedsubscriptions and schedsubscriptions to return both immediate and digest alerts.
Generating Alert E-mails
Once the alert is created the system will check for a match every few minutes by looking for changes in the content database. When a change is found and it matches a subscription, an alert e-mail is generated. In the event that versioning is enabled and the user with the alert does not have access to the new version an alert will not be sent. The process that supports this on the server site is the timer service. The immediate alert e-mail is seen below.
 
Each list basetype in WSS will have an alert template associated with it, which drives the UI behaviors, filtering, and e-mail content associated with a given alert.
Alert templates will be stored in the property bag for the list if it has been customized. This allows for the case where the list is provisioned from a basetype, and then columns are added or removed from it.
The mechanism to support multiple alert templates per list is to have separate toolbar buttons for the list with the appropriate alert template passed in as a parameter on the subnew.aspx page
SharePoint also supports multiple formats for the field to be rendered in e-mail:
1.      String: Including HTML. Text is truncated at 255 characters, which is set as an attribute in the template.
2.      Image: Image is rendered in the message, and included in the message.
3.      Link: The user is sent a hyperlink, for e-mail and HTTP links.

The mapping of SharePoint field types to those sent out in e-mail are as follows:

      String      Image      Link
Single line of text       X            
Multiple lines of text       X            
Choice (menu to choose from)       X            
Number (1, 1.0, 100)       X            
Currency ($, ¥, £)       X            
Date and Time       X            
Lookup (information already on this site)                   X
Yes/No (check box)       X            
Hyperlink or Picture (format Hyperlink)                  X
Hyperlink or Picture (format Picture)            X      
Calculated (calculation based on other columns)      X            

We collect multiple edits made to a given document/item in a quantum (5 minutes), and represent them as one change. This means, for example, that five simultaneous edits of a document are represented as one change in the immediate e-mail notification (instead of sending five separate e-mails). The e-mail will be formatted as a digest alert.
 

Digest (daily/weekly)
There will be one daily digest sent per web. The sections in the mail are composed of each of the list types or items the user has created a daily alert for (individual sub-sections are defined in the formatting section for daily per alert template).
Ï      Multiple edits to the same item appear under one row in the section  changed information is aggregated with multiple asterisks in a given row if necessary.
Ï      The Announcements digest section has the text Alert created by P J Hough  when creating digests for the user, if content is due to an alert created by another user, this text should be emitted below the digest section for that alert.
Ï      The links for items take users to item display forms.
Ï      The links for e-mail addresses or hyperlinks boot a new e-mail message or Microsoft Internet Explorer®.
Ï      The links for lists take users to the default view of a list (note that SharePoint does not remember if an alert was specific to a view).
Ï      The list of items is sorted by the list-name alphabetically (item alerts also appear with a list header).
A digest e-mail looks like the one you see below:
 
Try This
1.      On you SharePoint site log in as a regular user.
2.      Create several alerts both immediate and digest (on digest alerts set the delivery time to be the top of the next hour).
3.      Log in as a different user and modify, add, and delete some list items.
4.      Start Outlook on the client machine and view the alerts. You will have to wait until the top of the next hour to see the digest alerts so continue with the course until that time.
Whats Under the Hood
The tables that are most important when alerts are to be generated are the tables in the content database that start with the word event. In general terms, these tables are used as follows:
EventBatches  Keeps track of the most recent event that has been processed for alerting
EventCache  Stores events used in immediate alerts along with an id that is used in eventbatches. The eventtype is also stored in this table.
EventLog  Stores events used for digest alerts.
EventReceivers  Used for custom event handlers.
EventSubsMatches  Used as a temp table during alert processing.

A SQL trace of the processing of alerts will show the following events in:
exec proc_SecGetDomainGroupMapData '00000000-0000-0000-0000-000000000000', -1
exec proc_GetEventDataAndSubscriptionFilters
exec proc_SecGetDomainGroupMapData '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 3
exec proc_SecGetPrincipalById '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 1, 1, 1
exec proc_GetMatchingSubscriptionsData '85986DA3-A2DF-49FA-A9AB-DA4350265BAC'
exec dbo.proc_getObjectsByBaseClass @BaseClassId = '8D8B6E93-D1E7-449A-A522-C35CBCE1BA63', @ParentId = 'F8C2D09B-3AD5-4A1C-BE17-7FBDE06A5308'
exec proc_SecGetPrincipalById '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 0, 0
exec proc_SecGetPrincipalById '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 0, 0
exec proc_SecGetPrincipalById '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 0, 0
exec proc_SecGetPrincipalById '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 0, 0
exec proc_InsertEventSubcriptionJunctionEntries
exec proc_EnumSubscribedSites
declare @P1 datetime set @P1='Apr 21 2006  8:10:13:217PM' exec proc_MatchSchedSubscriptions '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 1, @P1 output select @P1
exec proc_DeleteEventLog '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 'Apr 14 2006  8:10:13:000PM'
exec proc_EnumSubscribedSites
declare @P1 datetime set @P1='Apr 21 2006  8:10:13:227PM' exec proc_MatchSchedSubscriptions '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 2, @P1 output select @P1
exec proc_DeleteEventLog '08D83ACA-1B80-44D0-9400-530A7B3FFDF5', 'Apr 14 2006  8:10:13:000PM'
exec proc_UpdateSchedSubscriptionTimes 'Apr 21 2006  8:10:13:000PM'
Demo: Alert Processing
Please watch the demo <m6d1alertprocessing.avi>  
The instructor should create some alerts and cause them to fire by changing the data in the site and then run a profiler trace on his or her machine capturing 5 minutes worth of data (long enough for the timer service to send alerts). You might want to capture this traffic beforehand to save time. Look in the trace for the alerts processing. This should commence with the command:
exec proc_SecGetDomainGroupMapData '00000000-0000-0000-0000-000000000000', -1
and end with
exec proc_UpdateSchedSubscriptionTimes 'timestamp
Use query analyzer to run each command and talk about the results as well as what the system uses that information for.




Alerts Web Service
The alerts web service is available to manipulate and display information about alerts for the authenticated user. The service URL is http://server/_vti_bin/alerts.asmx. If you browse to that URL you will see the list of valid operations for this service. The valid operations are DeleteAlerts and GetAlerts. These are fairly self explanatory in that DeleteAlerts will allow the deletion of alerts when provided unique ids for each alert. GetAlerts will return a list of the alerts for the currently logged on user and the current URL. Every site has an _vti_bin so changing the request URL will alter the scope of the command.
The web service returns xml that contains the information about alerts.
 
Data in this format can be a bit difficult to work with. You can use the alerts web service to create web parts in SharePoint designer that can display information about the alerts a user has. This allows for cleaner formatting and more usefulness.
 
Demo: Alerts Web Service
Please watch the demo <m6d2alerts.avi>  
Try This
Start SharePoint designer on your client machine and build the web part you see above.
1.      Open the site.
2.      Create a new aspx file called alert.aspx.

 
3.      Open the new file in the editor.
4.      Click Data View>Insert Data View.

 
5.      Under xml web services, click connect to web service (the URL is http://servername/_vti_bin/alerts.asmx).
 

6.      Click Connect Now.
7.      The default operation is getalerts which is what we need to use.
8.      Click OK.
9.      It should now appear in the datasource library so that you can click the drop-down on it and select Show Data.

 
10.      If you do not have any alerts on the site you need to create some and then click Refresh Data Source.
11.      If you have alerts created they will appear toward the bottom of the xml tree in the data source details.
12.      Highlight the following and click insert selected fields as > multiple item view

Title, Alertforurl, Editalerturl, frequency, address

 
13.      Once you have done this, you will have a fairly ugly web part that uses the alerts web service.

 
14.      To improve things a bit you should click the menu on one of the items in the Alert for URL column and format it as a hyperlink.

 
15.      Change the text to display to View item.

 
16.      Click OK.
17.      Do the same thing for the editalerturl column but use Edit Alert for the text to display.
18.      Now the web part looks much better.

 
19.      Attach the master page for the site to it (this will add the chrome) the URL is /_catalogs/masterpage/default.master Format>Master Page>Attach Master Page and use the default.

 
20.      Save the page and view it in the browser.

 

Global Administration
There are only a few options available to administer alerts. Other than the previously mentioned pages allowing managing individual and managing all users alerts there are some global settings that allow controlling alerts for all sites and all users. These options can be found on the central administration web site with the web application settings on the application management tab.
 
The global page for e-mail and alert settings includes:
Ï      Alerts quota per user, set at 500 by default.
Ï      Alerts on/off for the virtual server.
Ë      Note that turning off alerts for the virtual server will disable all alerts currently created and prevent the creation of new ones.
Ë      If alerts are disabled, clicking the new alert button will take the user to a page with the text:

Alerts have been turned off for this virtual server. For assistance, contact your server administrator.

Ë      If alerts are re-enabled, the existing alerts defined will restart their processing and function as before.
Other relevant settings include:
Ï      SMTP server definition (Outbound E-mail Server)
Ï      From e-mail address definition for e-mails sent from the virtual server
Ï      Reply-to e-mail address definition for e-mails sent from the virtual server
 
Rights model
There are several rights used at the web, list, and item level for alerts:
Right      Scope      Description
Manage my alerts      Web      Used to allow users to create, edit and delete their own alerts, granted to reader by default (this right is implied and not explicitly grantable
Manage alerts on the web      Web      Used to allow users to manage alerts for all users in the web, granted to contributors by default
View item      Web/List/Item      Used to check at alert creation and notification time that the user has the right to view the item

Alerts will be security trimmed at send time, ensuring that unauthorized access to content is not possible.
Security Trimming
Unlike in WSS V2, security trimming will be a key component of the alerts infrastructure  SharePoint will check both when the user creates an alert and when sending an alert that the user has permission to view the item.
There are two steps to the process of alerts security trimming:
1.      When list items are added, modified, or deleted:
a.      SharePoint records item metadata in the alerts event cache for the changed item.
b.      SharePoint does a lookup on the Perms table for the items binary ACL blob and store the binary blob in the alerts event cache as dbo.eventcache.acl.
2.      When alert events match an immediate/daily/weekly subscription:
a.      Processing is segmented by site collection, so that cached user tokens are used most effectively.
b.      The users WSS token is retrieved from the User table.
c.      A request is made to the AD for each receiving users NT token.
d.      An ACL check is done with the stored binary ACL blob, users WSS token and NT token for read access.
Upgrade
The alerts OM is backward compatible with the V2 feature, and code written against alerts in V2 will continue to work in V3. There will be schema changes in the feature, however, and migration will require reprovisioning of alerts. This is similar to reprovisioning of data for other V2 datatypes, like lists, where in V3 we will have altered schema.
Alerts upgrade will require several properties in the system to be correctly set:
Ï      Timer service up and running
Ï      SMTP server defined
Ï      Alert templates defined and restored
Ï      User subscriptions defined and restored
Logging
Alert processing and notification sending will be logged. The following table describes the events logged, in both verbose (logs all events, for reference) and exception modes (exceptional events the admin needs to be aware of).

Event      Verbose      Exception logging only
Alert created      X      
Alert modified      X      
Alert deleted      X      
Alert filter/formatting could not be applied      X      X
Alert status was modified      X      
Send e-mail notification successfully      X      
SMTP server connection not available      X      X
Recipient not found (mailbox error)      X      X
Filter incorrect, user alert and filter deleted      X      X
Begin matching in SQL      X      
Complete matching in SQL      X      
Begin XML matching      X      
Complete XML matching      X      
Begin ACL trimming      X      
End ACL trimming      X      
Backup and Restore
Alerts will get backed up with site content. Restore will restore alerts for sites.



I ran this:
1. Run the following query against the content database of problematic site
select * from eventcache where EventData is not null
This will out put all fo the subscritions which have not been processed yet. We can
see if there are some alerts which are not processed. Export the result to us.
and there were no results and the query executed succesfully.
I also ran this:
2. select * from eventlog where ListID = 'xxx'
Export the result to us.
You can get the ListID from the EventCache table by running
Select * from EventCache and check the documents which correspond to the
problematic list
and this was the result:  
Msg 8169, Level 16, State 2, Line 1
Conversion failed when converting from a character string to uniqueidentifier.


Finally, when I look at the columns EventData and ACL on EventCache, ALL rows are NULL.  
ASKER CERTIFIED SOLUTION
Avatar of rjdennis
rjdennis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeremypemberton
jeremypemberton

RJdennis, thank you for posting back about your problem, I have just resolved my alerts as well! I only did:

 stsadm.exe -o setproperty -url http://ProblemSite -pn job-immediate-alerts -pv "every 1 minutes"

no restart of services nothing.

Thanks a lot.
I did the same as jeremy no service restart and BAM! 100 test requests came thru lol.  I was spelling the command with alert in stead of alerts too for a bit.  All well now ty all!