Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
Are you using AD Groups? –  Hugh Wood Nov 29 '12 at 11:07
    
Yes we are using the LdapRoleProvider for groups, but this script is adding users. –  gaotter Nov 29 '12 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 Wood Nov 29 '12 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. –  gaotter Nov 30 '12 at 9:05
    
Are the AD groups nested at all? Nested groups can't be read for permissions by all functions. –  Hugh Wood Nov 30 '12 at 9:19
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.