Hi - I would like to programmatically retrieve all user alerts from sharepoint 2007 in a format which would then allow me to set against another instance of sharepoint (2013). This would require iterating through all webs/lists and storing as csv or xml.
I plan to iterate the SPAlertCollection, get the values, store and then set against another collection.
Does this approach sound possible? Any examples of guidance appreciated.
static void Main(string[] args) { _siteUrl = ""; _collWebsites = _site.AllWebs; foreach (SPWeb oWebsite in _collWebsites) { SPAlertCollection collAlerts = oWebsite.Alerts; foreach (SPAlert oAlert in collAlerts) { Console.WriteLine("Website Title: {0} || Alert Title: {1} || User: {2}", oWebsite.Title, oAlert.Title, oAlert.User.LoginName); } }