{"id":1553,"date":"2013-09-11T11:56:27","date_gmt":"2013-09-11T10:56:27","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=1553"},"modified":"2013-09-11T12:06:11","modified_gmt":"2013-09-11T11:06:11","slug":"ldap-role-provider-argument-exception","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2013\/09\/11\/ldap-role-provider-argument-exception\/","title":{"rendered":"LDAP Role Provider Argument Exception"},"content":{"rendered":"<p>If you&#8217;re seeing the following error in the ULS logs, hopefully it&#8217;ll be as simple a fix for you as it was for me:<\/p>\n<p>LdapRoleProvider.GetRolesFor() exception: {0}.System.ArgumentException: The (&amp;(((ObjectClass=group))(member=CN=Some User,CN=Users,DC=domain,DC=local)) search filter is invalid.<\/p>\n<p>at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext()<\/p>\n<p>at Microsoft.Office.Server.Security.LdapRoleProvider.GetRolesFor(String userOrGroupDN, DirectoryEntry groupContainer, LdapDistinguishedNameManager ldapDnManager, List`1&amp; userRoles)<\/p>\n<p>To resolve this error, all that&#8217;s required is to updated the Group and User filter values for the role provider in the forms web application and the security token&#8217;s web configuration files.<\/p>\n<p>The role provider settings I had looked something like:<\/p>\n<pre lang=\"xml\">\r\n<roleManager>\r\n  <providers>\r\n    <add name=\"SPRoleManager\" type=\"Microsoft.Office.Server.Security.LdapRoleProvider, Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\" server=\"domain.local\" port=\"389\" useSSL=\"false\" groupContainer=\"CN=users,DC=domain,DC=local\" groupNameAttribute=\"cn\" groupNameAlternateSearchAttribute=\"samAccountName\" groupMemberAttribute=\"member\" userNameAttribute=\"sAMAccountName\" dnAttribute=\"distinguishedName\" groupFilter=\"((ObjectClass=group)\" userFilter=\"((ObjectClass=person)\" scope=\"Subtree\" \/>\r\n  <\/providers>\r\n<\/roleManager>\r\n<\/pre>\n<p>Notice the values for <em>groupFilter<\/em> and <em>userFilter<\/em> &#8211; <em>((ObjectClass=person)<\/em>.<\/p>\n<p>This is correct for the Central Administration web configuration. For the forms web application and security token&#8217;s configuration this should be updated to <em>(&amp;amp;(ObjectClass=person))<\/em>.<\/p>\n<p>Perform an IIS reset and next time you log in the exception in the ULS log should be resolved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re seeing the following error in the ULS logs, hopefully it&#8217;ll be as simple a fix for you as it was for me: LdapRoleProvider.GetRolesFor() exception: {0}.System.ArgumentException: The (&amp;(((ObjectClass=group))(member=CN=Some User,CN=Users,DC=domain,DC=local)) search filter is invalid. at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext() at Microsoft.Office.Server.Security.LdapRoleProvider.GetRolesFor(String userOrGroupDN, DirectoryEntry &hellip; <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2013\/09\/11\/ldap-role-provider-argument-exception\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[33,3],"tags":[88,63,81],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/plx2I-p3","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1553"}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=1553"}],"version-history":[{"count":10,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1553\/revisions"}],"predecessor-version":[{"id":1563,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1553\/revisions\/1563"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=1553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=1553"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=1553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}