Sign in to follow this  
Followers 0
Wolfmorder

RunasSet an application

11 posts in this topic

Hi,

I wanna run a small program looking like this :

RunAsSet("username", @Computername, "password")

RunWait ("\\server\path\application.exe","\\server\path")

RunAsSet()

Autoit is giving me an error message like this "Network name not found" (Traduce from french)

Now if I'm changing the path to a local drive it work just fine but I wanna be able to run it from a server.

Any idea ? Thx

Share this post


Link to post
Share on other sites



Paste the whole script and remove the password.

Because it should work.

Share this post


Link to post
Share on other sites

This is the whole script :) I only do that and it's giving me that error. I've seen many other posts about this on this forum without a clear answer.

Local it work but not on a Network...

Share this post


Link to post
Share on other sites

Can you browse to \\server\path using explorer?

If you say no:

add the IP and the server name to your hosts file

if you say yes:

sorry, I have no idea

Share this post


Link to post
Share on other sites

There has been several posts on this subject and it basically comes down to:

After you do the RunAsSet the credentials change to the local account which very likely doesn't have any rights to the server share.

So to go around this issue you first copy the file to the users local disk, then do the RunAsSet and run the local version of the program.

Make sure you also change the WorkDir if you started the script from the server.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

QUESTION (for those familiar with RunAsSet()):

Running RunAsSet on a computer and then accessing a network application that does not allow the user on that computer to authenticate would also cause this, no?

QUESTION (for Wolfmorder):

Is network authentication done on the computer level or at the domain level? What do RunAsSet and RunWait return when calling them in your code? You need validate the output for those so you know what to do to fix the problem. You may also want to try replacing @Computername with @LogonDomain.

I am not real versed in the workings of RunAsSet but knowing the MS security model these are all valid considerations.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

QUESTION (for those familiar with RunAsSet()):

Running RunAsSet on a computer and then accessing a network application that does not allow the user on that computer to authenticate would also cause this, no?

<{POST_SNAPBACK}>

What do you mean with "accessing a network application"?

RunAsSet changes the credentials for the programs shelled by Run and RunWait, like RUNAS does.

The returncode of runasset is not really important since runasset doesn't really do anything yet. it will only be 0 when the OS doesn't support it.

There is in this case also no returncode for RunWait() since AutoIt stops with an error. you need the set Opt("RunErrorsFatal", 0) to get a returncode.

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Sorry JdeB I missed the line about it erroring out in his original post.

Forget my questions... the problem here is the network connection between the local PC and the PC on which you are running the app from is no good. Verify the path and it should work.

Let's make sure I understand what I am talking about here. It sounds like the error is occurring on the RunWait line not the RunAsSet line if it cannot find the connection. Please verify.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

This runs well. I don't get any errors. I'm also using a domain level admin account.

There are some programs that our users are not "allowed" to run and putting a script

like this on a share helps.

Code:

; Set the RunAs parameters to use Domain level adminstrator account

RunAsSet("AdminId", "Domain", "Password")

; Admin = Administrator Domain = Domain name (NA - North America), Password = ;self explanatory

; Run IPINFO.exe program

RunWait("\\KPAPPS\D$\Apps\IPINFO.exe",)

; Reset user's permissions

RunAsSet()

RocTx

Share this post


Link to post
Share on other sites

I think local computer with username: "username" must join domain to the server...so when you do RunAsSet, user at local computer will be changed into "username" and it will also connect to the server...so you can run application at server (if you have rights)..

Sorry if you don't undertand my bad english.... :">

Share this post


Link to post
Share on other sites

If there is a domain account with the same name and password as a local account, credentials will be passed on from the local to the domain.

eg.

Local = Administrator with password 12345

Domain = Administrator with password 12345

RunAsSet("Administrator", @ComputerName, "12345")

RunWait("\\Server\Share\path\executable", "\\server\share\path\")

should run the same as

RunAsSet("Administrator", @logonDomain, "12345")

RunWait("\\Server\Share\path\executable", "\\server\share\path\")

Must use share name as well as in Roctx example "\\KAPPS\D$\Apps..."


CheersNobby

Share this post


Link to post
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
Sign in to follow this  
Followers 0