How to Configuring an NTP Time Server on ESXi PowerCLI

How to Configuring an NTP Time Server on ESXi PowerCLI

If there are no NTP server configured

Get-VMHost esx01 | Add-VMHostNtpServer -NtpServer ntpservername

 

Or to first of all clear existing NTP server(s) then set the new one:

Get-VMHost esx01 | Remove-VMHostNtpServer -NtpServer (Get-VMHost esx01 | Get-VMHostNtpServer)
Get-VMHost esx01 | Add-VMHostNtpServer -NtpServer ntpservername

 

Source link 

How to check VMFS version & block sizes PowerCLI

How to check VMFS version & block sizes PowerCLI

Get-Datastore | Get-View | Select-Object Name,@{N="VMFS version";E={$_.Info.Vmfs.Version}},@{N="BlocksizeMB";E={$_.Info.Vmfs.BlockSizeMB}}

 

NameVMFS 	      version   BlocksizeMB
----------------    -----------
TempDS                  5.58 	 1
datastore1              5.54  	 1
datastore1 (3)          5.54  	 1
datastore1 (1)          5.54  	 1
datastore1 (4)          5.54  	 1
datastore1 (7)          5.54  	 1
datastore1 (6)          5.54  	 1

VMware ESXi   CDP information via PowerCLI

VMware ESXi   CDP information via PowerCLI

  1. Using PowerCLI, connect to the ESX host or vCenter Server:# Connect-VIServer esx-or-vc-hostname
  2. Run this script in PowerCLI:
Get-VMHost | Where-Object {$_.ConnectionState -eq "Connected"} |
%{Get-View $_.ID} |
%{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |
%{ foreach($physnic in $_.NetworkInfo.Pnic){
    $pnicInfo = $_.QueryNetworkHint($physnic.Device)
    foreach($hint in $pnicInfo){
      Write-Host $esxname $physnic.Device
      if( $hint.ConnectedSwitchPort ) {
        $hint.ConnectedSwitchPort
      }
      else {
        Write-Host "No CDP information available."; Write-Host
      }
    }
  }
}

Continue reading VMware ESXi   CDP information via PowerCLI