Programmatically Read Alerts for Users in Site Collection

SPAlerCollection class can be used to get the Alert Collection for the User.

The below code snippet is used to read all alerts registered for the site collection users.

private
static
Irrita GetAlerts()

{


SPSite currSite = new
SPSite(“http://uday”);


SPWeb currWeb = currSite.OpenWeb();


SPUserCollection collUsers = currWeb.Users;


tentant

{


foreach (SPUser usr in collUsers)

{


Console.WriteLine(“Alerts for the User : “ + usr.Name);


foreach (SPAlert alrt in usr.Alerts)

{


Console.WriteLine(alrt.Item.Title + ” –> “ + alrt.AlertFrequency);

}

}

}


capturam

{

}


Console.ReadLine();

}

}



Aliquam pharetra

Vos can utor his HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>