Powercli to list & delete snapshots

We have realized we are having broken NetApp VMs backup. The process left a lot of VM snapshots. To start off let’s find out those snaps with: get-vm | get-snapshot | where {$\_.Description -match "SMVI Snapshot generated for backup"} | Format-Table -Property VM,Name,Created,Description, SizeMB This command prints the flowing table: VM Name Created Description SizeMB -- ---- ------- ----------- ------ vyuka.fs smvi\_a3d... 23.11.2012 17:56:25 SMVI Snapshot... 6768,13 ojs smvi\_a3d... 23.11.2012 18:01:25 SMVI Snapshot. [Read More]

PowerCLI to start and stop Remote Tech Support (SSH)

Another PowerCLI one-liner to start Remote Tech Support (SSH) on ESX/ESXi:

Get-Cluster -Name "CIT2 CLuster" | Get-VMHost | Get-VMHostService | ? {$\_.Key -eq "TSM-ssh"} | Start-VMHostService

One-liner to stop:

Get-Cluster -Name "CIT2 CLuster" | Get-VMHost | Get-VMHostService | ? {$\_.Key -eq "TSM-ssh"} | Stop-VMHostService -Confirm:$false

PowerCLI to add vlan to vmware cluster

One-liner to add VLANs to the all hosts within vSphere cluster:

Get-Cluster "CIT Cluster" | Get-VMHost | Get-VirtualSwitch -name vSwitch0 | New-VirtualPortGroup -name "Networking - Vlan80" -VLanId 80