Jump to content

RunAs / RunAsWait problem on server 2012R2 [SOLVED]


 Share

Recommended Posts

RunAsWait(@UserName, @ComputerName, "!PASS!", 0, "C:\Program Files (x86)\UserService\Admin.exe")


Try that. You need to supply the Username, either yours or theirs, that will give you whomever is logged on.

i ran this as a test, my password on vm is Hello1, lol, you don't need extra '' around the path to exe.

RunAsWait(@UserName, @ComputerName, "Hello1", 0, "C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe")

 

I am a Universalist now? sweet... keep em coming guys

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

:>

I should have remembered to update this thread, when I found the solution - but I didn't.

The solution was to edit the Group Policy for admin users, default it's set to Enabled

Local Computer Policy -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> User Account Control: Run All administrators in Admin Approval Mode |-> Disabled

Changing the above, made my script work as it did in server 2008 (apparently I had changed the above in 2k8 also)

 

I haven't checked if it works in win10, course I don't have win10 installed.

 

Cheers
/Rex

Link to comment
Share on other sites

Instead of disabling UAC for the whole system, you could just disable it for Admins to allow run your script.  

Local Computer Policy -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode |-> Elevate without prompting.  

 

Adam

 

Link to comment
Share on other sites

  • 4 weeks later...

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
 Share

  • Recently Browsing   0 members

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