Sign in to follow this  
Followers 0
Airwolf

RunAsSet($username,@computername,$password) not working on network path

9 posts in this topic

#1 ·  Posted (edited)

@computername doesn't seem to do it's job when I run my script from a network path. Is there some other way to use local credentials if I'm running the script from let's say \\othermachine\userdata\shared? The script is doing a RunAs on a file in \\othermachine\userdata\shared\installfolder and it gives me bad username or password error. It seems like it's trying to use the credentials as a network user.

EDIT - By the way, I cannot use psexec.exe, our network virus scanner picks it up and toasts it.

Edited by Airwolf123

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites



@computername doesn't seem to do it's job when I run my script from a network path. Is there some other way to use local credentials if I'm running the script from let's say \\othermachine\userdata\shared? The script is doing a RunAs on a file in \\othermachine\userdata\shared\installfolder and it gives me bad username or password error. It seems like it's trying to use the credentials as a network user.

EDIT - By the way, I cannot use psexec.exe, our network virus scanner picks it up and toasts it.

Does the LOCAL credentials have any rights on the \\othermachine ?

Alternative: Copy the file first to a local directory and then run it.


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

Does the LOCAL credentials have any rights on the \\othermachine ?

Alternative: Copy the file first to a local directory and then run it.

Yes, it has full rights on the \\othermachine.

And I can't copy the file unfortunately, it's a 300MB install.


Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yes, it has full rights on the \\othermachine.

One thing to try is to set the Workdir to a directory thats available for the RunASSet userid.. (second parameter of Run/RunWait)

And I can't copy the file unfortunately, it's a 300MB install.

Don't you do the same when running it ? It will still copy.... 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

One thing to try is to set the Workdir to a directory thats available for the RunASSet userid.. (second parameter of Run/RunWait)

Don't you do the same when running it ? It will still copy....

I tried using @desktopdir and a few others, same problem. And if I do copy then install, it will have to copy 300MB then install it, then remove the files. I may have to resort to that, but I don't want to if I don't have to.

Is there a way to do a Run("\\something\somefolder\someprogram.exe")? It won't let you use UNC paths as a command, but is there some way in autoit to run a network path file? As I said earlier, I can't use PSExec.


Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I tried using @desktopdir and a few others, same problem. And if I do copy then install, it will have to copy 300MB then install it, then remove the files. I may have to resort to that, but I don't want to if I don't have to.

Is there a way to do a Run("\\something\somefolder\someprogram.exe")? It won't let you use UNC paths as a command, but is there some way in autoit to run a network path file? As I said earlier, I can't use PSExec.

That should be possible...

Where is the script located when started ? also on a networkshare or locally?

did you try: Run("\\something\somefolder\someprogram.exe",@tempdir) ?

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

That should be possible...

Where is the script located when started ? also on a networkshare or locally?

did you try: Run("\\something\somefolder\someprogram.exe",@tempdir) ?

I just get an incorrect parameter error. The script is on a network share, but it doesn't work if I have a script dump it locally first either.


Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

I just get an incorrect parameter error.

Don't understand the error you get. Can you show the exact syntax you use when getting the error ?

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

#9 ·  Posted (edited)

hi,

i guess i have the same problem as airwolf.

when i run a program (a compiled .au3 script) with the runasset userid and there are macros in the program like @logonserver the macro is not passed to the runasset user.

example:

MsgBox(0, "logonserver for " & @UserName & ":", @LogonServer)
; user is the runasset user
DirCopy(@LogonServer & "\somefolder\someotherfolder", @ProgramsCommonDir & "\somefolder\someotherfolder", 1)

@username is the runasset user, @logonserver is empty... but the macro @programscommondir is set correctly.

any ideas?

Edited by domi974

---------------------------------------------

cheers

kimon

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