My most frequently used PowerCLI One-liner

This posting is ~6 years years old. You should keep this in mind. IT is a short living business. This information might be outdated.

Over the last months I wrote different PowerCLI One-liners who I want to share. Nothing fancy and one or two are ugly. But they worked for me. :)

Changing the multipathing policy for all hosts and datastores in a cluster

Get a list of all VMs in a cluster and the datastore in which the VMs resides

Get a list of all VMs, their mac-address and the connected port groups

vMotion of a VM between hosts without a shared storage (not really a One-liner…)

Enable SSH on all hosts

Check on which hosts SSH is enabled

Get a list of hosts and the numer of VM that are running on these hosts

If you’re searching for more advanced PowerCLI stuff visit the blogs of Alan Renouf and Luc Dekens.

Patrick Terlisten
Follow me

Leave a Reply

Your email address will not be published. Required fields are marked *