SCVMM 2012 R2 conveniently lets me run scripts on hosts using the Run Script Command.
When not using a runas account, the scripts are run on the host using the Local System account which seems to be unable to run elevated commands. In particular, I want to run the Get-VM Hyper-V cmdlet on the host, and this cmdlet does not work (or rather, returns an empty list) from a non-elevated Powershell.
I don't want to disable UAC because I don't want want to weaken overall security on the host just for this particular scenario.
Is it possible to use SCVMM's Run Script Command to run elevated commands on the host? Alternatively, can I get Get-VM to return the list of VMs even when run non-elevated?
(In case it's interesting, I want to run Get-VM on the host rather than Get-SCVirtualMachine on SCVMM because I'm interested in the IDs of the SCSI controllers of the VM, and it seems that SCVMM and Hyper-V each return different IDs. If there's a way to get the Hyper-V-visible ID from SCVMM cmdlets then I won't need to run any script on the host at all).