VMware Cloud Community
wiggy66
Contributor
Contributor

ESX Server and VMs Audit Script

Hi All,

I hacked together a script using snippets from other scripts in this forum.

The idea behind this script is to display a summary of all ESX servers and a second table for summary of VMs.

I manage an environment that is used by developers who will add and delete VMs on a regular basis and I need a simple way for them to view ESX and VM detail without using vSphere client.

The script sorta works but if anyone interested in tweaking it to make it faster!

Cheers

Reply
0 Kudos
1 Reply
Zsoldier
Expert
Expert

The first thing I would change w/ this script is the static root and password entries.  You should have the script prompt for this stuff if running interactively or encrypt it in a cred file.

You can use something like this for interactive running:

$Creds = $Host.UI.PromptForCredential("Need Credentials", "Please provide an account with read access to your ESX Server.", "","") 
Connect-VIServer esxserver -Credential $Creds

Or something like Hal's script to export credentials in an encrypted file:

http://poshcode.org/501

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos