Recently had a need to validate the configured LUN path settings in some of our VMware environments. The prospect of checking them through the VIClient GUI was less then appealing as was checking via command line on each VMhost. So I used VMware's new PowerCLI PowerShell plugin to automate the information gathering. After I did this, my co-worker found a script to set preferences by odd/even Set HBA Preference
We have multiple environments so I tried to make the settings as generic as possible. I added date/time and VIServer to the file name so that it wouldn't get over written if you were running it before and after a configuration change or against different environments.