static void Main(string[] args) { using (SPSite site = new SPSite(args[0])) { foreach (SPWeb web in site.AllWebs) { try { if (web.HasUniqueRoleAssignments) { Console.WriteLine(web.ServerRelativeUrl); var col = web.RoleAssignments; foreach (SPRoleAssignment item in col) { string[] roles = item.RoleDefinitionBindings.Cast<SPRoleDefinition>().Where(b => b.Name != "Beperkte toegang").Select(b => b.Name).ToArray(); if (roles.Length > 0) { if (item.Member is SPGroup) { SPGroup g = (SPGroup)item.Member; if (g.Users.Count > 0) { Console.WriteLine("Groep: {0} - Role(s): {1} ({2} members)", item.Member.LoginName, string.Join(", ", roles), g.Users.Count); } } else { SPUser user = (SPUser)item.Member; if (!user.IsSiteAdmin) { Console.WriteLine("User: {0} - Role(s): {1}", item.Member.LoginName, string.Join(", ", roles)); } } } } Console.WriteLine(); } } finally { web.Dispose(); } } } }Note. Roles "Beperkte toegang", Dutch name for the role "Limited access" is filtered out, and users that are SiteCollection administrators are excluded from the results to create a more readable result.
Posts tonen met het label SharePoint 2010. Alle posts tonen
Posts tonen met het label SharePoint 2010. Alle posts tonen
donderdag 27 november 2014
List assigned right for a site collection
A quick way to find out the rights assigned to a site collection.
Labels:
SharePoint,
SharePoint 2010,
SharePoint 2013
woensdag 22 augustus 2012
Compiler warning: There was a mismatch between the processor architecture of the project being
I recently created a new SharePoint 2010 development machine. Since Visual Studio 2012 is out now I decided to use this version of Visual Studio. Everything works fine, but I receive a compiler warning:
Since I do not want to change the deployment target platform, the most simple solution is to suppress the error message.
Unload the project en edit the project file.
Add the following to the (first) propertygroup element
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Since I do not want to change the deployment target platform, the most simple solution is to suppress the error message.
Unload the project en edit the project file.
Add the following to the (first) propertygroup element
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
maandag 20 augustus 2012
No ULS log for web applications with a custom application pool account
When recreating a new SharePoint I noticed no ULS for a web application. When creating a new managed account in the new web application wizard the user is not added to the "Performance Log Users" group.
When adding the used to this group, and a IIS reset, ULS log started to appear for the web application.
Abonneren op:
Posts (Atom)