Jump to content

Recommended Posts

Posted

With $RUN_LOGON_NETWORK it implies (from my understanding) that the AutoIt process will authenticate only to access network resources with that specified account, but it will use current credentials to access local resources.  All other flags will generate @error and pid will be set to 0.

Posted (edited)

But, using the $RUN_LOGON_NETWORK (2) logon_flag is the only way RunAs will work with a valid password.  All other logon_flag values fail with a valid password.

The bottom line is I want to be able to detect both cases; (1) RunAs should fail with an invalid password (2) RunAs should succeed with a valid password.

Edited by jaja714
reword
Posted

Here is my test code:

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

For $ii = 1 to 16
    $xpid = RunAs(@UserName, @ComputerName, '{validpass}', $ii, @SystemDir & '\calc.exe', @DesktopDir, @SW_HIDE)
    ProcessClose($xpid)
    $ypid = RunAs(@UserName, @ComputerName, 'invalidpass', $ii, @SystemDir & '\calc.exe', @DesktopDir, @SW_HIDE)
    ProcessClose($ypid)
    ConsoleWrite($ii&@TAB&$xpid&@TAB&$ypid&@crlf)
    ProcessClose($xpid)
Next

and here are my results:

1   0       0
2   16960   3024
3   0       0
4   0       0
5   0       0
6   5780    13388
7   0       0
8   0       0
9   0       0
10  9512    6556
11  0       0
12  0       0
13  0       0
14  15844   17612
15  0       0
16  0       0

 

Posted

My results :

0   6780    0
1   6880    0
2   6300    5412
3   6572    0
4   7552    0
5   1452    0
6   6656    6580
7   5336    0

No need to go further than 7.  And 0 is a valid value for RunAs.  So it seems to me that your "valid password" is invalid.

Posted

Wait, I think I might have to use @LogonDomain instead of @ComputerName.  So, when I'm logged into VPN, I will authenticate against that domain but, when I'm not connected, I will authenticate locally.

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...