Archive for March, 2011

Get IP address of virtual machines running on Hyper-V – FIXED!

Wednesday, March 16th, 2011
Big thank you – goes to Max Trinidad my fellow MVP from Powershell group…
Here is errorless script - much better than mine! :)
Copa, paste and save as .ps1 - then run on your Hyper-V server and you will get IP’s of your virtual machines…

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

## – Use Line below to list all your Virtualization Class
#get-wmiobject -namespace “root/virtualization” -list

## – Load filter (or function first)
filter Import-CimXml{

    $CimXml = [Xml]$_
    $CimObj = New-Object -TypeName System.Object
   
    foreach ($CimProperty in $CimXml.SelectNodes(“/INSTANCE/PROPERTY”)){
        if ($CimProperty.Name -eq “Name” -or $CimProperty.Name -eq “Data”){
            $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE
        }
    }
   
    $CimObj
}

## – Collect WMI Virtual information
$getWmiVirtual = Get-WmiObject -Namespace “root\virtualization” -Query “Select * From Msvm_ComputerSystem” | sort-object elementname

## – Build your results from your collected objects
ForEach($v in $getWmiVirtual){
    $vm = $v.ElementName;
    $VmObj = Get-WmiObject -Namespace “root\virtualization” -Query “Select * From Msvm_ComputerSystem Where ElementName=’$vm’”;
    $KvpObj = Get-WmiObject -Namespace “root\virtualization” -Query “Associators of {$VmObj} Where AssocClass=Msvm_SystemDevice ResultClass=Msvm_KvpExchangeComponent”;
    if($KvpObj.GuestIntrinsicExchangeItems -ne $null){
        write-host $vm;
        $KvpObj.GuestIntrinsicExchangeItems | Import-CimXml | where {$_.NAME -match “NetworkAddressIPv4″} | ft;
    }
}

## – End of Script

Gadgets for ITPros and not only…

Friday, March 11th, 2011

Yesterday I was attending SloWUG meeting in Ljubljana… There was Joze Markic having a session (part 2) about various programs / gadgets / tools to simplify your daily tasks… I am inviting you to take a look at his PPT presentation that can be found on his blog.

Oh! There is also part 1 published on SloWUG PPT repository

Website and other services monitoring…

Tuesday, March 1st, 2011

There is a great tool to get your public services monitored… It’s called mon.itor.us… It gives you alot of free features but you can still pay and use some more sofisticated…

Check this out: