How to Run Hyper-V Management Tools with Alternate Credentials
runas /user:Administrator mmc — This prompt for local administrator password and then started a blank MMC console.
Load Hyper-V .MSC file: runas /user:Administrator "mmc \"C:\Program Files\Hyper-V\virtmgmt.msc\""
Note that \" is an escaped quote (needed for quotes inside of quotes). This prompted me for a password and ran the Hyper-V Manager.
Get rid of password prompt: runas /savecred /user:Administrator "mmc \"C:\Program Files\Hyper-V\virtmgmt.msc\""
Create a shortcut that passed this whole command to CMD.EXE – as follows: C:\Windows\System32\cmd.exe /s /c "runas /savecred /user:Administrator "mmc \"C:\Program Files\Hyper-V\virtmgmt.msc\"""
Final steps: Get shortcut a Hyper-V icon from "%ProgramFiles%\Hyper-V\SnapInAbout.dll" and to change the shortcut to run minimized by default.
Post a Comment