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.

Follow me

Patrick Terlisten

vcloudnine.de is the personal blog of Patrick Terlisten. Patrick has a strong focus on virtualization & cloud solutions, but also storage, networking, and IT infrastructure in general. He is a fan of Lean Management and agile methods, and practices continuous improvement whereever it is possible.

Feel free to follow him on Twitter and/ or leave a comment.
Patrick Terlisten
Follow me

Leave a Reply

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

I accept!