Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is user an administrator from cmdline?

Status
Not open for further replies.

QAteste

Technical User
Jun 14, 2002
23
US
Thanks for looking....

Any idea on how you can test from the command line if the current user is a member of the Administrator group?

There is a IsUserAnAdmin() of the shell32.dll but I couldn't get it to work. I tried 'rundll32 shell32,IsUserAnAdmin' and 'rundll32 shell32, IsUserAnAdmin <username>' niether of which seemed to work correctly. I would check the errorlevel afterwards and whether the user was an Administrator or not, it alwways returned the same error level.

Maybe a query a registry key?

Any help is much appreciated.
 
QAteste,
local or domain?
on your specific machine or a remote one?
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top