This is a collection of useful PowerCLI functions that various people have created. Below is a summary. I plan on updating this over time so feel free to bookmark it if you find it useful.
Table of Contents
“Function Get-MotionHistory”
Returns the vMotion/svMotion history
“Function Get-VIEventPlus”
Returns vSphere events
“Function Get-VMAdvancedConfiguration”
Lists advanced configuration setting (VMX Setting) for a VM or multiple VMs
“Function Set-VMAdvancedConfiguration”
Sets an advanced configuration setting (VMX Setting) for a VM or multiple VMs
“Function Export-PermissionsToCSV”
Exports all vCenter Permissions to a CSV file.
“Function SendMail”
Sends an email.
“Function WriteExitStatus”
Writes to the event log.
“Function Copy-VMwareLog”
Copies the “vmware.log” file from the specified VM to the $env:temp directory.
“Function Import-EncryptedText”
Import encrypted text from the specified file.
“Function ConnectTovCenter”
Connect to vCenter using a secure password.
“Function Get-VMIPandMAC”
Get VM IP addresses and MACs.
“Function Get-ClusterIPs”
Lists VM Host Interface, IP, Subnet and MAC.
“Function Get-VMHostHBAAll”
Lists VM Host HBA info – Cluster, VMHost, HBAName, Type, Device, Model, Driver and WWPN/iSCSI Alias/iSCSI Name (if available).
“Function Get-VMHostsCanonicalName”
Lists the VMHost’s CanonicalNames using the following column format: Cluster, Host, CanonicalName, CapacityGB.
“Function Get-DSName”
Pulls the datastore name based off of the NAA ID.
“Function Compare-VMHostsDisks”
Pulls up the number of disks attached to every host in the cluster. This is useful if you suspect improper zoning/masking.
“Function Get-VMSwapping”
Outputs the following: Cluster, VMHost, VM, SwappedMemory, BalloonedMemory.
“Function Install-VMwareODBC”
Creates a 64-bit System DSN for vCenter Server.
“Function Get-Uptime”
This script will report uptime of given computer since last reboot.
“Function Get-ServerNetAdapters”
Output a list of server names and network adapters.
“Function Get-VMHostCPURatio”
Report on the CPU Overubscription Ratio for all hosts that you request.
“Function Get-VMHostMemRatio”
Report on the Memory Usage Ratio for all hosts that you request.
“Function Get-VMHostHBAHealthAll”
Check for an identical number of targets, devices & paths. Ignores HBAs that are not in use.
“Function Get-VMHostHBAHealth”
Output the HBA Device, Target, LUN and Path info for each HBA – compare these values to check for mismatches.
“Function Get-VMHostNICHealth”
Get the vmnic status (up/healthy or down/unhealthy) for the specified VMHosts.
“Function Get-VMDiskInfo”
Retrieves: Datastore, VMs within datastore, VM Volume, VM TotalSpace, VM FreeSpace, VM UsedSpace
“Function Get-VMHostHBAHealthMultithread”
Multithreaded script. Check for an identical number of targets, devices & paths. Ignores HBAs that are not in use.
“Function Compare-VMHostsDisksMultithread”
Multithreaded script. Pulls up the number of disks attached to every host in the cluster. This is useful if you suspect improper zoning/masking.
“Function Get-VMHostNICHealthMultithread”
Multithreaded script. Get the vmnic status (up/healthy or down/unhealthy) for the specified VMHosts.
“Function Get-VMDiskInfoMultithread”
Multithreaded script. Retrieves: Datastore, VMs within datastore, VM Volume, VM TotalSpace, VM FreeSpace, VM UsedSpace