Friday, September 14, 2007

Alerts not going from SharePoint 2007 site.

Problem: Alerts not going from SharePoint 2007 site.

Description: On my SharePoint 2007 Portal, like any other portal, I had quite a few document libraries. I had also configured alerts to be sent to users whenever a change would happen to the document libraries. Some users had subscribed to the alerts themselves. But for some reason, the alerts were just not being delivered to the users' mailbox. If a user subscribes to receive alerts, he/she would receive the initial email informing about the subscription, but they wouldn't receive subsequent actual alert mails.

Context: Users are authenticated from Active Directory. Their email ids etc. are also picked from AD. All the users have valid email ids (obviously. Duh!). Regular email from Outlook works fine. Sending and receiving of emails from external domains also works fine.

Solution: There are many possibilities why this could happen. I have tried to list down all possible solutions. One of these should work for you.

1. Check the account running SharePoint
a. Make sure the WSS service is running under an account that has rights to the Exchange Server and (of course) the SharePoint database server.
b. Make sure that account has a valid entry in the AD
c. Make sure there is an email id create in the Exchange Server for that account
d. Make sure the account has rights to send emails on the Exchange Server (this should be there when you add the account in Exchange, but just double check)

If, after doing the above steps, alerts are still not working, then follow these steps:

· Check the database tables that are used for subscriptions and alerts. There has been a known issue where some errors have arisen from incorrect information with them so just check them. Checked these tables:
* SchedSubscription
* ImmedSubscription

· Check the Event Log for errors
· Check the “Timer Job Definitions” page within Central Administration. This page lists all the job definitions defined within MOSS2007, such as "Backup and Restore", "Content Deployment" and as you would expect "Alerts". On looking at the list you noticed the following lines:

"Immediate Alerts MOSS_MYSITE"
"Immediate Alerts MOSS_SSP"

This shows that my "Shared Services" and my "My Sites" web applications were working fine for alerts and had a timer job associated with them. What I would have expected to see also was a similar line to below for my "Intranet" web application but this was not there.

"Immediate Alerts MOSS_INTRANET"

(Note: in your case, MOSS_INTRANET would have the name of your web application)

· Now run the following STSADM command to enable alerts:

stsadm.exe -o setproperty -url http://intranet -pn alerts-enabled -pv true

(Note: replace “intranet” with the name of your web application)

· Then run the following to set the alerts to run every 5 minutes:

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

· Then, wait for a few minutes and bingo, it works. There is a side effect though. You will receive a bunch of alert emails. All of the alerts in the queue get sent in one shot. :)
· Then, re-configure the process to run every 1 minute instead of 5 minutes with the following command:

stsadm.exe -o setproperty -url http://intranet -pn job-immediate-alerts -pv 1

OR

stsadm.exe -o setproperty -pn job-immediate-notification -pv 1

This should do it!

No comments: