Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli
One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.
PowerCLI can be a bit overwhelming to use, But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI
http://powergui.org/index.jspa
and
Reports can be generated from:-
VMware Community Pack
http://www.virtu-al.net/featured-scripts/vmware-powerpack/
vCheck Daily Report
http://www.virtu-al.net/vcheck-pluginsheaders/vcheck/
If you do want a script, LucD (1 of *the* premier PowerCLI gurus; literally co-wrote the book on PowerCLI :) ) provides a script in the following link:
http://www.lucd.info/
It's worth getting this book!
http://www.amazon.com/gp/product/0470890797?ie=UTF8&tag=lucnot-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0470890797