Posted On August 30, 2019

1-Liner to Find Host of Virtual Machine in Hyper-V

kimconnect 0 comments
blog.KimConnect.com >> Codes >> 1-Liner to Find Host of Virtual Machine in Hyper-V
PS C:\Users\testAdmin> (get-item "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters").GetValue("HostName")
hyperv01.intranet.kimconnect.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How to Add a Replica into an Existing Availability Group using PowerShell

Overview:0. Add secondary replica to the cluster by running some commands on the availability group…

PowerShell: Quickly Add Users into Groups on a List of Computers

$newVmNames=@( 'SERVER0001', 'SERVER0002' ) $newUsers=@( 'domain\user1' ) $groupNames='Administrators','Remote Desktop Users' $newVmNames|%{ invoke-command -computername $_ {…

PowerShell: Play with Time

1. Constructor: $timer=[System.Diagnostics.Stopwatch]::StartNew() 2. Accessing a property $totalSeconds=$timer.Elapsed.TotalSeconds 3. Output Time (Usage): $hours=[math]::round($totalSeconds/3600,2)write-host "It has…