Solved

As I can determine, that the user A is included into group B?

Posted on 2004-03-29
10
232 Views
Last Modified: 2010-04-05
I know, that there is NetUserGetGroups function.
But the situation is possible: user A -> group C -> group B.
Using NetUserGetGroups function I receive group C.
How to find out, to what groups the group C belongs?
0
Comment
Question by:EgorovAlex
  • 4
  • 2
10 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10705250
EgorovAlex, a better description may entice someone to answer your question. Myself, i' haven't a clue what your asking.

<smile>

Shane
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 200 total points
ID: 10705954

Being that global groups can only contain users, and local groups can only contain users or global groups, I believe your setup is as follows (please correct if I am wrong).

user A - global group C - local group B

In order to find all the groups that C belongs to, you will need to perform a NetLocalGroupEnum to enumerate all the local groups on the server, then for each local group obtained, you will need to perform a NetLocalGroupGetMembers call in order to determine if the global group C exists in the local group.

If you require code for this example then just ask.

Regards,
Russell


0
 
LVL 11

Assisted Solution

by:shaneholmes
shaneholmes earned 200 total points
ID: 10706013
EgorovAlex,

Take a look at this set of free components:

http://www.wilsonc.demon.co.uk/delphi.htm

NT Specific Components


The TNetServer component allows you to connect to local or remote servers and  enumerate, add and delete users and groups.  It also allows you to find the primary domain controller (PDC) for a domain, list trusted domains, and force full and partial replications across the domain.

The TNetUser component allows you to examine and change the various properties for an NT user account.  It also allows you to add and remove users from global and local groups.

The TNetLocalGroup and TNetGlobalGroup component allows you to examine and change the various properties for NT groups.  It also allows you to add and remove users from the groups.
 
Shane
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:EgorovAlex
ID: 10706483
2 shaneholmes:
Thank you for link.

2 rllibby:
I have the following situation in my Active Directory (Win2003):
user A - global group C - global group B
0
 

Author Comment

by:EgorovAlex
ID: 13194992
Unfortunately I have not received the full answer to my question:
      
I have the following situation in my Active Directory (Win2003):
user A - global group C - global group B

How I can determine what the user A is included into group B?
0
 

Author Comment

by:EgorovAlex
ID: 13200187
Also i have SID's for user A and group B (if it can help)
0
 

Author Comment

by:EgorovAlex
ID: 14972412
Unfortunately I so have not received the answer as it is possible to determine, that the global group C is included into global group B
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now