Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Determine User Privilege

Status
Not open for further replies.

RKHohmII

Programmer
Mar 18, 2003
4
US
I need to determine if the user running my program has
Administrator privileges. I would image this is easily
accessible via some class's methods, but it's not jumping out at me from the documentation. Can anyone please point me in the right direction?

Thank you,

Rick
 
You can check to see if they are in a specific group (such as administrator) by using ADSI (ActiveDs namespace).

myUsers = GetObject("WinNT://MyCompuer/Administrators")
Dim bAdmin as Boolean
For Each member In myUsers.Members
If member.class = "User" Then
If UCase(member.name) = "dwilli2" Then
bAdmin = True
End If
End If
Next

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top