Username, local group, IsInRole

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to do the following on the WinXP SP2 using .Net framework 1.1 &
C#:

If I know the username (can be domain user or just local user), I do not
know the password, and I know the group name (local group) and the user is
NOT the current user, how can I determine if:
1. The user is defined on this machine
2. The user belongs to the local group

The check will be performed on the machine itself so no client-server access
issues.

Thanks in advance,
Anna
 
AFAIK if you operate locally, then there is no Active Directory info. You
can P/Invoke and use security API or network management api

Have a look at these functions
NetUserAdd
NetUserEnum
NetUserGetRroups
NetUserGetLocalGroups - returns local groups to which the user belongs
etc....

These functions reside in win32 dll - Netapi32.dll
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top