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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking NT User Group Membership

Status
Not open for further replies.

Hexonx

Programmer
Jan 10, 2001
102
US
Does anyone know how to retrieve all available NT User Groups and check if the currently logged on user is a member of a particular group?
 
Hi Hexonx,

Just wanted to see if you ever got a solution figured out - I'm keen to do the same thing and figure there must be an API call out there to handle it but no-one seems to know.
Let me know if you found the answer out.

Cheers

Brendan
 
There's a FAQ that may get you pointed in the right direction: faq222-818
 
The simplest way I have seen thus far is to use ADSI. In a small paragraph of code you can iterate thru a security hierarchy. Being merely a novice with ADSI, there is much more that can be done, but it sure made security checking much easier. And it's consistent across the various Windows platforms.
 
It's only consistent if you actually have an Active Directory running...

Actually, come to think of it, it's consistent if you don't: it won't work.

On the other hand, if you are running Active Directory, then it can simplify a lot of tasks.
 
Thanks guys,

Not sure that that FAQ is quite what I was after, strongm, but thanks anyway.. I'm not running win2k either, so I might need another approach..

Thanks anyway guys - I'm sure I'll find an answer.

Cheers

BK
 
Sorry to hear that the FAQ was not of any assistance. Whilst it is not a direct answer to your query it contains much of the info you need to get VB to extract information from the Net series of API calls. The actual calls that you would need to handle are: NetQueryDisplayInformation (allows you to enumerate groups) and NetUserGetGroups (allows you to enumerate all groups a user is a member of)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top