Sign in to follow this  
Followers 0
gcue

isadmin on a remote machine?

8 posts in this topic

can i use isadmin to check admin rights on a remote machine?

Share this post


Link to post
Share on other sites



id like to use autoit to check if i have admin rights on a remote machine as part of an autoit script thats already trying to do something on that workstation.

so can't use isadmin on a remote machine? =/

Share this post


Link to post
Share on other sites

same network

Are the PCs on the same network, or over the internet?

Share this post


Link to post
Share on other sites

if they're on the same network.. can isadmin work?

Share this post


Link to post
Share on other sites

@gcue

Maybe this can get you started

Dim $WshNetwork, $oAdminGroup, $oMembers 
Dim $strUser, $strComputer, $bInAdmin, $member 
$bInAdmin = False 

$WshNetwork = ObjCreate("WScript.Network") 

$strcomputer = $wshnetwork.ComputerName 
$strUser = $WshNetwork.UserName 

$oAdminGroup = ObjGet("WinNT://"& $strComputer & "/Administrators") 
$oMembers = $OAdminGroup.members 

for $member in $oMembers 
    if StringUpper($member.name) = StringUpper($strUser) Then 
    $bInAdmin = True 
    EndIf 
Next 

If $bInAdmin = True Then 
    ConsoleWrite($strUser & " is in local administrator group"  & @LF)
Else 
    ConsoleWrite($strUser & " is in local administrator group"   & @LF) 
EndIf

regards

ptrex

Share this post


Link to post
Share on other sites

cool thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0