tsue Posted April 3, 2013 Posted April 3, 2013 hello, i want to create a program that finds the right admin or an admin with password so i can run a program with administrative privileges, some of the computers has admin as administrator admin principal etc. here is the code: Local $colUsers, $sTmp, $Array[1] = ["user"] $colUsers = ObjGet("WinNT://" & @ComputerName) If IsObj($colUsers) Then $colUsers.Filter = $Array For $objUser In $colUsers $sTmp &= $objUser.Name & @LF If $objUser.Name = "Administrador" Then MsgBox(0, "Users", "found" & $objUser.Name) runadmin($objUser.Name) ElseIf $objUser.Name = "Administrator" Then MsgBox(0, "Users", "found will run with: " & $objUser.Name) runadmin($objUser.Name) ElseIf $objUser.Name = "Admin" Then MsgBox(0, "Users", "found" & $objUser.Name) runadmin($objUser.Name) ElseIf $objUser.Name = "Principal" Then MsgBox(0, "Users", "found" & $objUser.Name) runadmin($objUser.Name) EndIf Next EndIf MsgBox(0, "Users", $sTmp) Func runadmin($username) RunAs($username, @ComputerName, "heyapple", 0, "runastest.exe") MsgBox(0, "Users", "cree") EndFunc i want to make sure i send a valid admin with the correct password so the program doesnt fail in its task
Gianni Posted April 4, 2013 Posted April 4, 2013 try with this dos command and parse the result"net localgroup administrators"bye Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now