vSphere PowerCLI One-liners
Get the time on all ESXi hostsĀ (Compatable with PowerCLI 4.1 up):
get-vmhost | select Name,@{Name="Time";Expression={(get-view $_.ExtensionData.configManager.DateTimeSystem).QueryDateTime()}}
Set the time on all ESXi hosts to the PowerCLI host's time (Compatable with PowerCLI 4.1 up):
get-vmhost | %{(get-view $_.ExtensionData.configManager.DateTimeSystem).UpdateDateTime((Get-Date -format u)) }
List all RDM disks (use the -Location paramater to narrow it down):
Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName

The vSphere PowerCLI One-liners by DefinIT, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

