Authenticate user against Active Directory and check if it's an administrator. RRS feed

  • Question

  • User1490168606 posted

    Hi, I'm able to authenticate user against AD but I cannot find how to know if this user is administrator or not, how can I do that? The following code that I use to autheticate users:

               Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, pwd)
                Dim obj As Object = entry.NativeObject
                Dim search As DirectorySearcher = New DirectorySearcher(entry)
                search.Filter = "(SAMAccountName=" & username & ")"
                Dim result As SearchResult = search.FindOne()
                If (result Is Nothing) Then
                    Return False
                End If


    Saturday, March 6, 2010 10:10 AM

All replies

  • User-1040643152 posted


    Saturday, March 6, 2010 3:55 PM
  • User1490168606 posted




    What is "User"?

    Sunday, March 7, 2010 2:40 PM
  • User-1200560727 posted


    Please go through the following url:


    I hope it will helpful to solve your problem.

    Tuesday, March 23, 2010 1:58 AM