1

I have found this code but it is for .Net 3.5+

' set up domain context    
Dim ctx As New PrincipalContext(ContextType.Domain)

' find a user
Dim user As UserPrincipal = UserPrincipal.FindByIdentity(ctx, "SomeUserName")

If user IsNot Nothing Then
   ' user exists - do something here....               
Else
   ' user does not exist - do something else....
End If

Is there any alternative that could work in .Net 2.0?

  • Look at some of the examples using DirectoryEntry object, like in this post: https://stackoverflow.com/questions/14813452/connect-to-active-directory-via-ldap – Stradosphere Apr 19 '18 at 17:39

0 Answers0