locked
Is there any way to get alerts for all users from sharepoint 2003 using web services? RRS feed

  • Question

  • I'm using Alert web service for getting alerts, When I am using getalerts() method  I'm able to get alerts when I use a particular credntail,I am able to get the alerts of that user.But I need all user alerts.

    • Moved by Qiao Wei Thursday, August 30, 2012 3:10 AM (From:SharePoint 2010 - Using Visual Studio with SharePoint and other programming)
    Wednesday, August 29, 2012 12:35 PM

All replies

  • Thursday, August 30, 2012 10:28 AM
  • Thanks for your response,I don't have server access I need to get alerts using sharepoint web service.

    Code:

    Alerts alerts = new Alerts();
                        alerts.Url = "http://site/_vti_bin/alerts.asmx";
                        ICredentials credentials = new NetworkCredential("UserName", "Password", "");
                        alerts.Credentials = credentials; ;
                        AlertInfo alertInfo = alerts.GetAlerts();
                        MessageBox.Show("Server: " + alertInfo.AlertServerName +
                "\nURL: " + alertInfo.AlertServerUrl +
                "\nWeb Title: " + alertInfo.AlertWebTitle +
                "\nNumber: " + alertInfo.Alerts.Length.ToString() +
                "\n Curreent User:" + alertInfo.CurrentUser +
                "\n Alerts:" + alertInfo.AlertServerType);              
    
                 foreach (Alert alert in alertInfo.Alerts)
                 {
                  MessageBox.Show("AlertTitle: " +alert.Title +
                      "\nAlertForUrl: " + alert.AlertForUrl);
                        }

                     

    Thursday, August 30, 2012 11:17 AM