Re: Detect if currently logged on user has administrator priviledges.



>From W2K enough CheckTokenMembership() only
http://support.microsoft.com/default.aspx?scid=kb;en-us;118626
Arkady

"Alexander Nickolov" <agnickolov@xxxxxxxx> wrote in message
news:exTHwEIYFHA.3464@xxxxxxxxxxxxxxxxxxxxxxx
> OpenProcesToken, GetTokenInformation with TokenGroups,
> IsWellKnownSid with WinBuiltinAdministratorsSid, for each
> returned SID. Use WinAccountDomainAdminsSid if you want
> to check for a domain admin.
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@xxxxxxxx
> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================
>
> "Dave" <davenospam@xxxxxxxxxxxx> wrote in message
> news:OWeu4xHYFHA.3032@xxxxxxxxxxxxxxxxxxxxxxx
>> Hello,
>>
>> I'm writing an application which must be run with administrator
>> priviledges.
>> How can I detect this from within the application? The code is all C++
>> and
>> once I've got the username I can use NetUserGetInfo to determine if it
>> has
>> admin rights. Getting the username is escaping me at the moment though.
>>
>> All help appreciated.
>>
>> Dave.
>>
>>
>
>


.



Relevant Pages

  • Re: Detect if currently logged on user has administrator priviledges.
    ... to check for a domain admin. ... Alexander Nickolov ... Microsoft MVP, MCSD ... Getting the username is escaping me at the moment though. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Workgroup File Sharing Problem XP HomeWorkstations 2003 File S
    ... Microsoft MVP - Windows NT Server ... Asks for username and password again. ... If the user account doesn't exist in it's local account database, ...
    (microsoft.public.windows.server.setup)
  • Re: Opt out of Password Requirement
    ... Jason Tsang - Microsoft MVP ... of your answer and didn't enter my own username. ... ALL my settings and desktop configuration are gone. ...
    (microsoft.public.windows.mediacenter)
  • Re: Way to enable a username w/o admin rights? Figure out who is admin
    ... BLOG --> http://blogs.dirteam.com/blogs/jorge/default.aspx ... We did not have any domain admin passwords, but all was not lost due to the ... someone remembered the username that the Domain Admin had used. ... Administrator username without having Domain Admin rights? ...
    (microsoft.public.windows.server.active_directory)
  • Local domain admin account
    ... In windows 2000 pro you can set a local domain admin by ... Just type the username and domain name and set ... username and passwords in control panel. ...
    (microsoft.public.win2000.security)

Loading