Hello

Thanks for the great program.

I'm trying to start a .bat file which starts powershell with RunAs administrator. When i start the bat file manually it runs fine, as administator, all good. But when i do the same thing thru PaExec it starts the bat file and powershell, but it is not run as administrator.

I'm using powershell to start PaExec with the parameters. But it looks this this:

\\dc01\paexec.exe \\dc02 -u domain\user -p password -h \\dc02\file.bat -n 120 -to 900 -lo \\dc02\logs\

This works, it just doesnt run my script as administator. Dont know if it's relevant, but the .bat file looks like this:

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""\\dc02\Install Script.ps1""' -Verb RunAs}";

Thanks in advance.

asked 18 Nov '14, 03:25

mwthrane's gravatar image

mwthrane
1112
accept rate: 0%

edited 18 Nov '14, 03:29

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×52
×8

Asked: 18 Nov '14, 03:25

Seen: 35,088 times

Last updated: 18 Nov '14, 03:29