...hopefully some useful VMware related stuff

PowerShell

2011-01-06 10:00

Initial ESXi Setup Script

Automates the initial setup of an ESXi host after first installation and IP addressing.   First connects to ESXi host   NETWORKING: Adds second vmnic to vSwitch0 Creates a second vSwitch (vSwitch1) with port group LAN and assigns 4 vmnics to it Moves all VirtualMachines if exist to LAN...
2010-10-09 23:00

Script to list local and removable disk usage

This script uses the wmi object of win32_logicaldisk and outputs to a table that displays free space on both local and removable disks and percent free. The output is shown next and script below:     SCRIPT:   $diskarray = gwmi win32_logicaldisk | where {$_.Size -gt 0} $diskobject =...
2010-07-06 21:00

Script to identify Inactive Active Directory User Accounts for an AD 2003 domain

Get all Active Directory users in the domain, pick out firstly User accounts which have never logged in and second get the last logged in time for each account which have logged in and report back any accounts which haven't logged in within the last 31 days. Couldn't find PowerShell cmdlets for...
2010-06-21 00:00

NetApp change Snapmirror replication throttling script

Wrote this script to get round an issue at a customers site with the Snapmirror replication taking too much of the bandwidth across a LES link. Because I wanted to enable and disable as well as report on the status of replication throttling I put all variants into the one script. There are 4 main...
2010-06-19 12:00

NetApp filer Aggregate space used by Volumes report

To avoid over-committing storage it is essential to know how much space you have assigned to volumes on your aggregates. If you just run an aggregate list, the amount of space shown as used and free doesn't equal the actual amount used. The script below creates a table showing Filer, the aggregate...
2010-06-08 22:00

NetApp Snapmirror Status - Email Report

PowerShell Script to Email a report of the status of Snapmirror Replication on your NetApp filers. The Script uses the PoSh OnTap Module downloadable from http://poshontap.codeplex.com/ which gives masses of NetApp PowerShell commands.   Download script HERE is also below the...
2010-05-25 12:00

Datastore Information script showing ESX and datastore name paths and multipathing settings

A great script by LucD on the VMware community forums: http://communities.vmware.com/thread/269695 Download HERE   - - - - - - - - - - - - - - - - - - - - # Script to Show Datastore Info (Multipathing etc.) # LucD $report = @() Get-VMHost  | Get-View | %{  $esx =...
2010-05-20 12:00

Display memory allocated and memory available across environment

Script displays total memory available in each cluster, total memory allocated to VMs in each cluster and a percentage allocated. If over 100% message stating over-commitment is present. Then a table for each host in the cluster and same items as above is displayed.   The script can be run...
2010-05-17 12:00

Display number of vCPUs assigned and vCPU to Core ratio

Script displays Overall number of Cores available over all hosts, then the number of Virtual CPUs assigned and then the ratio.   The script can be run from a standard PowerShell window, as it checks for the VMware snapin and loads if necessary. If no connection exists to vCenter server it will...
2010-04-15 12:00

List Emails through your Exchange Server between two dates

List Emails through your Exchange Server between two dates   I was troubleshooting an Email issue on an Exchange server and had sent emails with the subject 'Test'. I wanted to see all messages that matched this subject line in the last two days but thought it would be useful to script it so I...