Jump to content

Recommended Posts

Posted

Can someone explain to me why this is not working?

_login()
Func _login()
global $ini,$fileLoc,$sUserName,$sDomain,$sPassword,$usrtemp, $ini
  global $login=4,$pass=4,$domain=4,$i,$sUserName, $sDomain, $sPassword
  global $arrlogin[$login] = ["usr1", "usr2", "usr3", "usr4"]
  global $arrpass[$pass] = ["pass1", "pass2", "pass3", "pass4"]
  global $arrdomain[$domain] = ["domain", @computername, @ComputerName, @ComputerName]
   $sUserName = ""
   $sPassword = ""
   $sDomain = ""
For $i = 0 to $login - 1
  $ExtCmd = @ComSpec & ' /c echo "Testing credentials for: "' & $arrlogin[$i]
  RunasWait($arrlogin[$i], $arrdomain[$i], $arrpass[$i], 2,$ExtCmd, @TempDir, @SW_HIDE)
   If @error Then
    MsgBox(0, "", $arrlogin[$i] & " " & $arrdomain[$i] & " " & $arrpass[$i] & " failed")
    ContinueLoop
  Else
MsgBox(0, "", $arrlogin[$i] & " " & $arrdomain[$i] & " " & $arrpass[$i] & " worked")
ContinueLoop
  endif
Next

if $sUserName == "" Then
  MsgBox(0, "", "No Login worked, Please Contect the IT help desk.")
  Exit
EndIf
  EndFunc

I have been using so i can package programs up to be installed by users without admin.

80% are on the domain and so the fist one works, the remaining 20% are not. I started using the '0 - Interactive logon with no profile' flag in the runaswait, but this did not pick up the any of the user accounts even though the middle two are on the computer. Then I tried the '2 - Network credentials only' flag and not apparently they all work.. even though the last one is a made up user name.

Im sure you can see what I am trying to do here.. When on the domain it all works as it stops as the first user name and uses them credentials.

Do you have to do something special if you are trying to use the runaswait on workgroup computers?

Rob

  • 3 weeks later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...