Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

find the right admin

$
0
0
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

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>