venerdì 23 aprile 2010

a little script powershell

just a little script in powershell.

Today I need to ping all the powered on VM in a little test environment.

Here the script:

# Ping Powered On VM on a VM environment

Connect-VIServer MYVISERVERORESX

$VMS = Get-VM | Where { $_.Powerstate -eq "PoweredOn" } | get-vmguest

Foreach ($VM in $VMS){
$OutVideo = "Pinging " + $VM.HostName
$OutVideo
$MyIP = $VM.IPAddress
ping $MyIP
}

aLex

Nessun commento:

Posta un commento