Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Invoke-command with "Run As Administrator" on remote machines.

$
0
0

Hi,

I'm trying to run a command on a remote machine with the invoke-command cmdlet. The command fails with access denied in the eventlog. I need to run the remote session with "Run As Administrator" on the remote machine. Any direction on how to this is greatly appreciated.

Example:

$computers= get-content "./servers.txt"

Invoke-command -ScriptBlock {c:\temp\example.cmd} -ComputerName $computers


Viewing all articles
Browse latest Browse all 6937

Trending Articles