if
(Settings.Default.SPOnline) { clientContext.Credentials =
new
SharePointOnlineCredentials(cred.Username, cred.Password); }
else
{ clientContext.Credentials =
NetworkCredential(cred.Username,cred.Password,cred.Domain); }
WebCollection childWebs = web.Webs; ctx.Load(childWebs); ctx.ExecuteQuery();
foreach
(Web childWeb
in
childWebs) { ctx.Load(childWeb, w => w.HasUniqueRoleAssignments); ListCollection lists = childWeb.Lists; ctx.Load(lists); ctx.ExecuteQuery(); sb.AppendFormat(
"Site,{0},{1},{2}"
, childWeb.Title, childWeb.Url, childWeb.HasUniqueRoleAssignments); sb.AppendLine(); Console.WriteLine(
"Web Title: {0} - {1}"
, childWeb.Title, childWeb.Url); Console.WriteLine(
" Unique Permissions:{0}"
, childWeb.HasUniqueRoleAssignments);
(List list
lists) { ctx.Load(list, l => l.DefaultViewUrl, l => l.HasUniqueRoleAssignments); ctx.ExecuteQuery(); Console.WriteLine(
"List Name:{0}-{1}"
, list.Title, list.DefaultViewUrl); Console.WriteLine(
, list.HasUniqueRoleAssignments); sb.AppendFormat(
"List/Doc Lib,{0},{1},{2}"
, list.Title, list.DefaultViewUrl, list.HasUniqueRoleAssignments); sb.AppendLine(); } sb.AppendLine(); ProcessWebnLists(childWeb,ctx); }
Thanks for share.
Congratulations on the guru award.
Great article.
Thanks Andy