I'm writing a PowerShell script that adds users to a SharePoint site. To check if the user exists I'm calling the EnsureUser. But my issue is that the when calling this method with a ldap membership provider(Microsoft.Office.Server.Security.LdapMembershipProvider) (i:0#.f|ldapmembership|username) it always returns a user even the user do not exists in Active Directory. So I'm able to add uses that do not exists.
-
Are you using AD Groups?– Hugh WoodNov 29, 2012 at 11:07
-
Yes we are using the LdapRoleProvider for groups, but this script is adding users.– gaotterNov 29, 2012 at 11:32
-
Are you checking the user like this? SPWeb.EnsureUser(i:0#.f|ad_membership|user) (A code sample from you might help in this case)– Hugh WoodNov 29, 2012 at 11:42
-
Yes. $web = Get-SpWeb <url>;$user = $web.EnsureUser(i:0#.f|ldapmembership|username); #No exception even user does not exists i source.– gaotterNov 30, 2012 at 9:05
-
Are the AD groups nested at all? Nested groups can't be read for permissions by all functions.– Hugh WoodNov 30, 2012 at 9:19
|
Show 2 more comments