From: gunther.ebert@ixos-leipzig.de (Gunther Ebert)
Subject: Re: Manipulating Users and Groups
29 Jan 1997 04:33:09 -0800
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <32EF0660.6D15.cygnus.gnu-win32@ixos-leipzig.de>
References: <c=US%a=_%p=INTERGRAPH%l=HQ8-970128192727Z-12455@hq15.pcmail.ingr.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (WinNT; I)
Original-To: "Bailey, Mark E" <mebailey@ingr.com>
Original-Cc: "'GNU-Win32'" <gnu-win32@cygnus.com>
Original-Sender: owner-gnu-win32@cygnus.com

Bailey, Mark E wrote:
> 
> Which Win32 API calls should I use to manipulate users and groups?  At
> this time, I am just interested in users and groups on the local
> machine.  I need to get the current user's information and then verify
> that he/she is in the correct groups before allowing certain actions.
> 

Look in the MS documentation for the following functions:

GetUserName
NetUserAdd      (even for the local machine, I haven't found any other
way)
NetUserGetInfo
NetUserEnum
NetGetDCName
LookupAccountName
LookupAccountSid
InitializeSid
GetSidSubAuthority

If you want to know how to obtain a security descriptor of a
'well-known' group
(that means a group that is created by Windows NT during installation
like
'Administrators') without specifying the account or group name (these
names are
language dependend) look for the article 'Creating a World SID' in the
Win32 SDK
knowledge base

Gunther
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
