Re: Getting the SID for the Administrators group

From: Garfield Lewis (galewis_at_SPAM-NO-MOREca.ibm.com)
Date: 02/26/05


Date: Fri, 25 Feb 2005 19:44:41 -0500

Use the following piece of code:

...
PSID m_pAdminGroupSid=NULL;
SID_IDENTIFIER_AUTHORITY m_SidIdentAuth=SECURITY_NT_AUTHORITY;
...
m_Success=AllocateAndInitializeSid( &m_SidIdentAuth,
                                       2,
                                       SECURITY_BUILTIN_DOMAIN_RID,
                                       DOMAIN_ALIAS_RID_ADMINS,
                                       0,
                                       0,
                                       0,
                                       0,
                                       0,
                                       0,
                                       &m_pAdminGroupSid );
...

-- 
Garfield A. Lewis
DB2 UDB Development,
IBM Canada Laboratory
"Anthony Hunter" <anthony.hunter@_NOSPAM_.invensys.com> wrote in message
news:%23H3LmS1GFHA.3092@tk2msftngp13.phx.gbl...
>     Is there a way to get the SID for the Administrators group without
using
> LookupAccountName()? Since this requires a string for the account name,
and
> the Administrators name is translated on the different language OS's, the
> lookup won't always work.
>     Is there a more generic way to do this that will work on all language
> versions?
>
>
>
> Thanks,
> Anthony
> -- 
> Product Availability Developer
> Invensys Avantis - www.avantis.net
>
>


Relevant Pages

  • Getting the SID for the Administrators group
    ... Is there a way to get the SID for the Administrators group without using ... LookupAccountName()? ... Since this requires a string for the account name, ... Is there a more generic way to do this that will work on all language ...
    (microsoft.public.platformsdk.security)
  • Re: How to obtain the group name for "Administrators"
    ... Harald wrote: ... > depending on the OS language the Administrators group has different ...
    (microsoft.public.win32.programmer.networks)