Login to vCenter via PowerCLI without entering Credentials

Bored of entering your credentials every time you login to your infrastructure via PowerCLI? Ideally, if you are managing the virtual infrastructure of the same domain as the one you logged in, you should be already able to connect to vCenter and PowerCLI using your logged in credentials. Most of the times this is not the case in multi client support environment. Continue reading

Get Snapshots older than X Days – PowerCLI

Finding the virtual machines running on snapshots is a very common task and in this post i am going to show you a one liner that can pull snapshots older than X days. Here we go!

This is very critical because of the bad effects snaoshots can have on the virtual machines. VM’s running on snapshots for more than 72hrs are not supported by VMware. Continue reading

Rescan HBA on all hosts in a Cluster – PowerCLI

When a new storage has been presented to all the hosts in a cluster, sometimes we may need to scan the HBA’s for the ESXi to see the storage. Most of the times when you rescan HBA on one ESXi, the others also see the storage but sometimes we may have to rescan HBA on all the hosts. Continue reading

Snapshot List of VM’s from csv – PowerCLI

Many may have come across a situation where you need to take snapshot on a set a VMs for maintenance activities. In an environment having 1500+ machines, this can be tedious.The below command conmes in handy for such tasks. Continue reading

Enable SSH on ESXi host – PowerCLI

To enable SSH on one host, use the below command from PowerCLI.

Get-VMHost esxi-1.vmmaster.local | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" } | Start-VMHostService Continue reading 

Enable/Disable SSH on all ESXi hosts

Sometime you may see a need to enable or disable SSH on all hosts in a cluster. This post will help you achieve that quickly using the PowerCLI.

Connect to vCenter Server using PowerCLI and use the below command to check the status of the SSH and ESXi Shell on hosts. Continue reading