Wednesday, July 3, 2013
Get All Sites in a SharePoint form
Get All Sites in a SharePoint form
SPFarm farm = SPFarm.Local;
SPWebService service = farm.Services.GetValue<SPWebService>("");
foreach (SPWebApplication webapp in service.WebApplications)
{
foreach (SPSite site in webapp.Sites)
{
foreach (SPWeb web in site.AllWebs)
{
Console.WriteLine(web.Url);
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment