Getting info from inside a Virtual Machine on a private network

By | 2014-03-11

I’m in the process of creating some scripts to set up a isolated lab-domain with some other servers on a private network in Hyper-V.

But how do I know the DC is up and running before starting up the machines that will become member servers

My approach is this, if you use integration services you have something called “Data Exchange”, it turns out that this is on the virtual machine just some registry values located at HKLM:SOFTWAREMicrosoftVirtual MachineGuest. So when my DC is up and running I just add a line like this:

 

So now we have the value in the Guest, how to retrieve that information without any network connection to the guest.

What i did here was to build it around the New-CimSession cmdlet and just add the parameter VmName and the use splatting for the rest of the function.

 

And what i get back is a hash table containing the key-value pairs from the guest.

Mission accomplished.

(Of course you can send values to the guest as well, but that’s for another today)

Please take a look at Taylor Brown’s Blog Post “Customizing The Key Value Pair (KVP) Integration Component” as it was my starting point before converting it to CIM

Leave a Reply