471,627 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Username, local group, IsInRole

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

Dec 2 '05 #1
1 2188
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

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Anna" <An**@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
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

Dec 5 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Scott | last post: by
9 posts views Thread by Sameh Ahmed | last post: by
7 posts views Thread by Sameh Ahmed | last post: by
11 posts views Thread by Kirk | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.