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:
i want to make sure i send a valid admin with the correct password so the program doesnt fail in its task
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