Posts RSS Comments RSS 253 Posts and 411 Comments till now

Archive for the 'All' Category

Hyper-V and PowerShell : VMName to OSName mapping

I have been working on creating a Hyper-V app for Splunk that will allow Splunk users to associate Hypervisor data with products like XenDesktop, XenApp, and Exchange. One of the challenges I came across is mapping the Hypervisor VM name to the OS FQDN.

Thanks to Artem


function Get-VMDetails
        $ComputerName = $Env:ComputerName,



    # Creating HASH Table for object creation
    $MyObj = @{}

    # Getting VM Object
    $Vm = Get-WmiObject -Namespace root\virtualization -Query "Select * From Msvm_ComputerSystem Where ElementName=’$VMName’" -ComputerName $ComputerName

    # Getting VM Details
    $Kvp = Get-WmiObject -Namespace root\virtualization -Query "Associators of {$Vm} Where AssocClass=Msvm_SystemDevice ResultClass=Msvm_KvpExchangeComponent" -ComputerName $ComputerName

    # Converting XML to Object
    foreach($CimXml in $Kvp.GuestIntrinsicExchangeItems)

        $XML = [”>XML]$CimXml

            foreach ($CimProperty in $XML.SelectNodes("/INSTANCE/PROPERTY"))
                switch -exact ($CimProperty.Name)
                    "Data"      { $Value = $CimProperty.VALUE }
                    "Name"      { $Name  = $CimProperty.VALUE }

    # Outputting Object
    New-Object -TypeName PSCustomObject -Property $MyObj

Output looks like

RDPAddressIPv6             :
OSName                     : Windows Server 2008 R2
EnterpriseOSMajorVersion   : 6
ServicePackMinor           : 0
ProductType                : 3
OSPlatformId               : 2
SuiteMask                  : 18
CSDVersion                 : Service Pack 1
OSVersion                  : 6.1.7601
FullyQualifiedDomainName   : bd-xa60-01.home.lab
OSMinorVersion             : 1
NetworkAddressIPv6         : fe80::78e4:e94b:b5c0:be0b%12
OSBuildNumber              : 7601
ProcessorArchitecture      : 9
RDPAddressIPv4             :
ServicePackMajor           : 1
NetworkAddressIPv4         :
OSEditionId                : 10
IntegrationServicesVersion : 6.1.7601.17514

The 2011 Scripting Games

The 2011 Scripting Games begin on April 4, 2011 and run through April 15, 2011. What is the Scripting Games, you may ask? Well simply put, the Scripting Games are the premier learning event of the year for IT Pro’s and others who wish to master Windows PowerShell. Comprising 10 events, a registered contestant has seven days to create a solution to a scenario driven problem and post their code to a MVP maintained script repository for evaluation by a panel of internationally recognized judges. Daily leaderboards and prize drawings help to maintain the suspense throughout the two-week international event.


During the 2011 Scripting Games hundreds of contestants will submit thousands of scripts that will be reviewed by dozens of judges. Hundreds of thousands of spectators from all around the world will view the games themselves. Last year, participants from more than 100 countries participated in the Scripting Games. With an emphasis on real world scripting scenarios and problems, the scripts will be of immediate value to both the participants and to the spectators.


Preparation for the 2011 Scripting Games is already underway, with a learning guide, step-by-step tutorials, videos and other resources being generated on a daily basis. The 2011 Scripting Games all in one page is the portal for the games themselves. The 2010 Scripting Games all in one page is still available, as are the events from the 2009 Scripting Games.


Its been awhile… what have you been up to?

Sorry I haven’t been blogging much. While I have been very busy at work my Powershell exploits have not been idle 🙂

Here are some updates 🙂

Anyway… I just wanted to give you a heads up on what was going on with me. Shortly I plan to have a weekly or monthly blog post covering my BSonPosh module which is up to ~140 cmdlets.

BSonPosh v1 Powershell Module finally ships!

Thanks to 12 hours of time in an airplane I was able to put the finishing touches on my BSonPosh Module.

I have added help for all my cmdlets and created format files.

Download Here: BSonPosh V1

[Update]:: I had to post an updated zip file as I was missing some KMS cmdlets. Thanks Jason for pointing that out!

PowerScripting Podcast… Tonight!

Going to be a guest tonight on the PowerScripting pod cast. You can catch it live via the website or listen later.

Blogging from iPad

Trying out the new iPad app for WordPress. Typing is not perfect but it is not to bad either.

For those of you wondering I got an iPad because of the Citrix receiver. It make the device priceless. IMO… Everyone should have one.

Live Tweeting/Blogging Citrix Synergy!

Some really exciting news forth coming!

@BSonPosh #CitrixSynergy

Write-Log… What should it be?


Write a Logging Script/Module with functionality similar to Log4Perl : Link to Log4Perl Info

If you have any ideas on what functionality it should have please let me know by leaving a comment.

RE:Blog Geek Speak VDI Vendors Speak Out

This event is going to ROCK! The god of VDI himself ( is going to nail the VDI vendors to the wall… well not really but I know for fact he has some good questions for them.

Catch it on March 2, 2010.

More Detail:

Implementing XenDesktop 4.0 on Hyper-V R2

Citrix and Microsoft have teamed up to offer the “Implementing XenDesktop 4.0 on Hyper-V R2” virtual lab, an interactive, pre-built environment/training session for testing and viewing the XenDesktop 4 & Hyper-V solution. Check it out!

For details and a video, click here:

To launch the virtual lab, click here:

Next »