SPWebService webAppServices = (from webService in SPFarm.Local.Services.OfType<SPWebService>() where !webService.TypeName.Contains("Central") select webService).SingleOrDefault(); foreach (SPWebApplication webApp in webAppServices.WebApplications) { Console.WriteLine(webApp.Name); foreach (SPSite site in webApp.Sites) { Console.WriteLine("SITE URL:" +site.Url); foreach (SPWeb web in site.AllWebs) { Console.WriteLine("Web URL" + web.Url); //Use HasUniqueRoleAssignments property to check if the RoleInheritance is broken or not Console.WriteLine("Role inheritance " + (web.HasUniqueRoleAssignments ==true ? "Broken" : "Not Broken")); } } }
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment