Jump to content

Recommended Posts

Posted

I want to run an application with a  different user.

Below script works, but application is RunAs the current user, not the one provided in the script.

RunAs($sUserName, @ComputerName, $sPassword, $RUN_LOGON_NETWORK,"notepad.exe" ). 

If I use  $RUN_LOGON_PROFILE  as a parameter instead of $RUN_LOGON_NETWORK, it doesn't open the application.

Any help/guidance appreciated

Posted

Its a domain account. I want to run the application with a different domain account, like 'Run as with different user'.

  • Moderators
Posted

Well if it is a domain account, why are you putting the local computer as the domain? You would use your AD domain.

 

RunAs($sUserName, $sDomain, $sPassword, $RUN_LOGON_NOPROFILE, "notepad.exe" )

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

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