Hello Shashi,

Ok thanks a lot.

Regards,
Rafal

Dnia 13-08-2012 o godz. 11:19 Narayan, Shashi ,Crest napisał(a):
> Dear Rafal,
> 
> This might help you:
> 
> 
> Dim enTry As DirectoryEntry = New 
> DirectoryEntry("LDAP://SPRINGER-SBM/OU=Users,OU=OUname,DC=domainname,DC=com", 
> userid, password) 'LDAP://springer-sbm
>             Dim domainUser As String = 
> System.Security.Principal.WindowsIdentity.GetCurrent().Name
>             Dim objChildDE As DirectoryEntry
>             Dim str As String = ""
>             Dim strUser As String = ""
>             Dim count As Integer = 0
>             For Each objChildDE In enTry.Children
>                 Try
>                     Dim searcher As New DirectorySearcher(objChildDE)
>                     Dim results As SearchResultCollection
>                     results = searcher.FindAll()
>                     Dim result As SearchResult
>                     Dim sr As New DirectorySearcher
>                     Dim ssr As SearchResult
>                     Dim de As New DirectoryEntry
>                     For Each result In results
>                         Try
>                             If 
> result.Properties("sAMAccountName")(0).ToString = userid Then
>                                 searcher.Filter = "sAMAccountName=" + userid
>                                 searcher.PropertiesToLoad.Add("memberof")
>                                 ssr = searcher.FindOne
>                                 objChildDE = ssr.GetDirectoryEntry
>                                 objChildDE.Password = password
>                                 Try
>                                     Dim o As Object
>                                     o = de.NativeObject
>                                     Return True
>                                     Exit Function
>                                 Catch ex As Exception
>                                     Return False
>                                     Exit Function
>                                 End Try
> 
>                             End If
>                         Catch ex As Exception
> 
>                         End Try
>                     Next
>                 Catch ex As Exception
> 
>                 End Try
> 
> Shashi Narayan (Mr.)
> Crest Premedia Solutions Private Limited
> M +91 9730033080 | T   +91 20 7100 7055 |  E 
> [email protected]
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Rafal Laczek
> Sent: Monday, August 13, 2012 2:44 PM
> To: [email protected]
> Cc: [email protected]
> Subject: [jpassion_web] LDAP users
> 
> I need to connect/import LDAP users. Can somebody give any nice 
> tutorial, etc. how to do it in proper way.
> 
> Thanks.
> 
> Regards,
> Rafal
> 
> 
> 
> --
> You received this message because you are subscribed to the Google 
> Groups "JPassion.com: Web Programming Basics" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/jpassion_web?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Web Programming Basics" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jpassion_web?hl=en.

Reply via email to