Sign in to follow this  
Followers 0
netjunkie247

RunAS Help

6 posts in this topic

There is an application located on every workstation in our domain... currently the exe to update the app is on the local workstations as well... meaning that either the admin must manually login to all boxes to run the update for the app - use psexec and connect to all the boxes -- or give higher rights to the local users...

all of these seem to be bad options =o)

SO... the idea is to have a RunAS command to temp use domain admin creds' and install any updates... then reset the creds' and exit the process...

I'm also considering compiling this into an .exe and use it in our login script to fully automate the process from the users...

Below is the current code I have--

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

Dim $UserName, $Domain, $Password, $RunProgram, $RunPath

$UserName = "USERACCOUNT"

$Password = "PASSWORD"

$Domain = "DOMAIN"

RunAsSet ( $UserName, $Domain, $Password )

$RunProgram = "update.exe"

$RunPath = "C:\program files\etc..."

RunWait($RunProgram, $RunPath)

; Finished!

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

- If anyone has some direction on this... any help is greatly appreciated!

Share this post


Link to post
Share on other sites



thanks for the response... I did as you said-- the 'go' feature to test the code before compiling responded the following:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files\AutoIt3\Examples\bancpac-update.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>14:17:07 Starting AutoIt3Wrapper v.1.7.6

>Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Examples\bancpac-update.au3"

C:\Program Files\AutoIt3\Examples\bancpac-update.au3 (30) : ==> Unable to execute the external program.:

RunWait($RunProgram, $RunPath)

The parameter is incorrect.

+>14:17:07 AutoIT3.exe ended.rc:0

+>14:17:08 AutoIt3Wrapper Finished

>Exit code: 0 Time: 1.901

-thanks for your help with this...

Share this post


Link to post
Share on other sites

sorry... code was pretty much same as before...

I was able to get it working just fine-- no errors-- compiled the .exe and tested-- works great! thanks for the help!

Also, if i added:

RunAsSet () --- toward the 'end' of the script... does it reset the permissions back to the standard user profile that is logged in after the update.exe part of the script runs??

Share this post


Link to post
Share on other sites

RunAsSet () --- toward the 'end' of the script... does it reset the permissions back to the standard user profile that is logged in after the update.exe part of the script runs??

Only the shelled application will have the RunAsSet() credentials, not the script itself.

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

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