delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/29/04:33:09

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019