Skip to main content

Posts

Showing posts with the label Office 365

Update all Pages to entire Sites and SubSite using Client Object Model C#

If you want to update, Delete any and all the list, document library, publishing library to entire site collection. Following code will be helpful to achieve this requirements. public static class Program { static void Main(string[] args) { try { using (ClientContext _context = GetSiteContext(Constants.DeploymentSiteUrl)) { var webs = clientContext.Site.EnumAllWebs(w => w.Title, w => w.Lists); foreach (var web in webs) { foreach (var list in web.Lists) { if (list.Title == "Pages") { Console.WriteLine(web.Title + "-----" + list.Title); result.Add(web.Title + list.Title); CamlQuery query = CamlQuery.CreateAllItemsQuery(); query.ViewXml = @" "; ListItemCollection...