Jump to content

RunAs and "logon_flags" - please clarify


 Share

Recommended Posts

Greetings AutoIt users:

I just upgraded to the latest version of AutoIt stable (v3.2.12.1). I would appreciate it if someone would clarify the logon_flags help entries. Here's what I'm getting from the help file, please correct me where I'm wrong:

"0 - Interactive logon with no profile" - basically I can interact with the program but it has my environment, not the other user's. Equivalent to "su -p some_user" in bash.

"1 - Interactive logon with profile" - basically I can interact with the program but it has the other user's environment. Equivalent to "su -l some_user" in bash.

"2 - Network credentials only" - ?? No idea.

"3 - Inherit the calling processes environment instead of the user's" - ?? Not sure. It sounds like I could e.g. start a command prompt, specify some environment variables, then call this script from the command prompt with this flag, and the final program would have the same variables as the command prompt. Is that a correct interpretation?

Thanks for any insights.

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

Greetings AutoIt users:

I just upgraded to the latest version of AutoIt stable (v3.2.12.1). I would appreciate it if someone would clarify the logon_flags help entries. Here's what I'm getting from the help file, please correct me where I'm wrong:

"0 - Interactive logon with no profile" - basically I can interact with the program but it has my environment, not the other user's. Equivalent to "su -p some_user" in bash.

"1 - Interactive logon with profile" - basically I can interact with the program but it has the other user's environment. Equivalent to "su -l some_user" in bash.

"2 - Network credentials only" - ?? No idea.

"3 - Inherit the calling processes environment instead of the user's" - ?? Not sure. It sounds like I could e.g. start a command prompt, specify some environment variables, then call this script from the command prompt with this flag, and the final program would have the same variables as the command prompt. Is that a correct interpretation?

Thanks for any insights.

Why haven't you just tried it? All you need is a PATH or SET statement to see what was passed for the environment.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Um, I have tried it. Just because I see something doesn't mean that I understand what I see. But thanks anyway.

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

Um, I have tried it. Just because I see something doesn't mean that I understand what I see. But thanks anyway.

I meant the experiment you proposed yourself: "...start a command prompt, specify some environment variables, then call this script from the command prompt with this flag"

It was an excellent idea, and if you tried it with each of the various flag settings, I think you would have what you want.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

"2 - Network credentials only" - ?? No idea.

How would I test this? I'm not a big Windows person, I don't have a clue WTF this is.

Also, I presume you are a programmer? I'm trying not to think that I understand the whole thing when I'm perhaps missing some edge case. There's a big difference between "I can supply a flag that I don't understand and it works how I thought it would" and "I know how it works". I'm not looking for a hand-out, I'm admitting that I'm not quite getting it. :)

Thank you for your assistance though.

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

How would I test this? I'm not a big Windows person, I don't have a clue WTF this is.

Network credentials are passed to remote connections only, sort of like when you provide a user name and password to NET USE:
NET USE X: \\Server\Share\Folder Pa$$word /u:User

In AutoIt's RunAs(), I think it would apply to something like this:

RunAs("UserName", "Domain", "Password", 2, "notepad.exe \\Server\Share\Folder\File.txt", @TempDir)

In this case, the provided credentials are not used to access notepad.exe, but to proivde access to the networked file that notepad is supposed to open.

Also, I presume you are a programmer?

Way wrong and an insult to real programmers everywhere! :)

I'm trying not to think that I understand the whole thing when I'm perhaps missing some edge case. There's a big difference between "I can supply a flag that I don't understand and it works how I thought it would" and "I know how it works". I'm not looking for a hand-out, I'm admitting that I'm not quite getting it. :idiot:

Thank you for your assistance though.

You were right that I over-simplified it before. It is not obvious how you would test the resulting environment for the network credentials option. I write the occasional demo (as much to figure it out myself as for others), and I need to try one that uses each different type and somehow demonstrates the differences.

Hmmm... >_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

RunAs("UserName", "Domain", "Password", 2, "notepad.exe \\Server\Share\Folder\File.txt", @TempDir)

Hmm, that sounds reasonable. I'm guessing that since nobody has corrected me on the other stuff that I must be at least mostly correct.

Thank you for taking the time to answer! I would be interested in an example if you come up with one.

[EDIT] So basically "2 - Network credentials only" would be kinda, sorta, a little bit like "ssh -i another_key.pub someserver", only not really.

Edited by mrider

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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