Category Archives: Powercli-Powershell-Scripts

PowerCli Script to List HPE Driver and Firmware

PowerCli Script to get HPE Driver and Firmware, Its ‘s  been hard coded to BL-460Gen8 and Gen9 and can be changed as per requirement.  $vmhosts = Get-Cluster “ClusterName” | get-vmHost $report = @() foreach( $ESXHost in $vmhosts) { $HWModel = get-vmHost $ESXHost | Select Name, Model $esxcli = Get-ESXcli -vmhost $ESXHost if($HWModel.Model -eq “ProLiant BL460c

Read More

List the ESXi host Storage LUN Path-count, State, and DatastoreName

The below script is from Vmwareadmins.com. Thank’s to the post “http://www.vmwareadmins.com/list-the-path-and-path-state-for-every-vsphere-datastore-using-powercli/“ I have tweaked the script with few lines,  to list the DataStore Name and Naaid info, so it would be nice to have all objects in single pane of view.  All credits to “Eric Sarakaitis“   Power CLI Script :– $initalTime = Get-Date $date = Get-Date ($initalTime)

Read More

Custom SATP Claim Rule-Script for ESXi Host’s connecting to HPE 3PAR

Disclaimer:- The script below is from the Vmware community folks which is tweaked a little to suit my purpose, Also please test before running in production. Reboot is required to claim the LUN’s.  FYI:- In certain cases,  if the LUN is not RR already, running directly the Rule/script and rebooting the Host is not claiming the

Read More

Day 2 Day PowerCli scripts @Work

PowerCLi OneLiners :- Please test before you run in production.  #Find HA restarted VM’s Get-Cluster “Cluster-name” | Get-VM | Get-VIEvent | where {$_.FullFormattedMessage -match “vSphere HA restarted virtual machine”} | select ObjectName,CreatedTime,FullFormattedMessage    #Update NTP Servers Get-Cluster “Cluster-Name” | Get-VMHost | Sort Name | %{ $_ | Remove-VMHostNtpServer -NtpServer ($_ | Get-VMHostNtpServer) -Confirm:$false $_ |

Read More