Sign in to follow this  
Followers 0
fluff533

Runas

5 posts in this topic

I'm having a problem getting my MSI that resides on a network share to execute with the Runas function:

This works:

RunAs('localadmin', @ComputerName, 'pw', 0, "msiexec /i c:\abc.msi" /qb ALLUSERS=1", @SystemDir)

This does not work:

RunAs('localadmin', @ComputerName, 'pw', 0, "msiexec /i \\server\volume\directory\abc.msi /qb ALLUSERS=1", @SystemDir)

I gather the 'localadmin' account cannot see the server share but I don't know what I need to do to resolve the problem. I need to access the MSI with the logged in domain user account but use the credentials of the local admin account to install the MSI. Can anyone help? I'm new to scripting so...ya know...nuff said.

Share this post


Link to post
Share on other sites



Try copying it locally first and see if that works.

Share this post


Link to post
Share on other sites

Yeah...I think I mentioned it works locally in my original post. The problem is I don't want to have to copy the MSI locally - it's fairly big and I have over 1500 workstations. There must be a way to achieve this.

Share this post


Link to post
Share on other sites

I gather the 'localadmin' account cannot see the server share but I don't know what I need to do to resolve the problem. I need to access the MSI with the logged in domain user account but use the credentials of the local admin account to install the MSI. Can anyone help? I'm new to scripting so...ya know...nuff said.

You are right. localadmin cannot access the server share. You don't have too many choices:

1) Either use a domain account that have admin right on all domain computers and the server share

2) Before using RunAs() copy the msi to the computer, install with RunAs using the code below and then delete the msi.

3) Which I don't like to do. Give everyone permission to the server share.

RunAs('localadmin', @ComputerName, 'pw', 0, "msiexec /i c:\abc.msi" /qb ALLUSERS=1", @SystemDir)

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

You are right. localadmin cannot access the server share. You don't have too many choices:

1) Either use a domain account that have admin right on all domain computers and the server share

2) Before using RunAs() copy the msi to the computer, install with RunAs using the code below and then delete the msi.

3) Which I don't like to do. Give everyone permission to the server share.

RunAs('localadmin', @ComputerName, 'pw', 0, "msiexec /i c:\abc.msi" /qb ALLUSERS=1", @SystemDir)
I normally do #3, but its a specific folder that is shared exactly for that purpose, though I am normally using it to uninstall things.

"Human kind cannot gain anything without first giving something in return, to obtain; something of equal value must be lost."The Help File is truly your friend.

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