Virtual Network Management in Standard Switch Using Power CLI

This Post will help you to understand and create multiple port groups , Esxi host network details for complete environment  . Note : Below  commands are used on vCenter with One host , it can be used multiple servers environment . List vSwitch Inventory  Get-VirtualSwitch List Portgroup Inventory  Get-VirtualPortGroup Create a Virtual Switch Get-VmHost | […]

Read More

Find Number of VCPU used in a Cluster and ESXi hosts

This Post explain how can we generate an output contains , Total number of vCpu used in an vCenter Cluster , also it shows many vCPU used per Esxi hosts .  If you have  multiple Cluster it is very easy to find same using below script. Connect-VIServer  “vCenter Name” $TotalNumvCPUs = 0 Foreach ($Cluster in (Get-Cluster |Sort Name)){ $HostNumvCPUs = 0 Write-Host “Cluster: $($Cluster.name)“ Foreach ($ESXHost in ($Cluster |Get-VMHost |Sort Name)){ […]

Read More

NTP Conflagration with Power CLI

Check NTP Services status  Get-VMHost | Get-VmHostService | Where-Object {$_.key -eq “ntpd”}                 Check Firewall exception configuration  Get-VMHost | Get-VMHostFirewallException | where {$_.Name -eq “NTP client”}               Enable the FirewallException to all ESXi Hosts Get-VMHost | Get-VMHostFirewallException | where {$_.Name -eq “NTP […]

Read More

CBT Management with Power CLI

List all virtual machines where CBT enabled  Get-VM| Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $true} Check specific virtual machines where CBT enabled  Get-VM  “TEST-VM-01” | Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $true} List all virtuals machine where CBT disabled Get-VM| Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $false} Check specific virtual machines where CBT disabled Get-VM  “TEST-VM-01” | Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $false} Note : In GUI mode we cannot […]

Read More

Snapshot Management with Power CLI

Command to list the  properties of snapshot  using  power cli get-vm | get-snapshot | format-list Description Created Quiesced PowerState VM VMId Parent ParentSnapshotId ParentSnapshot Children SizeMB IsCurrent IsReplaySupported ExtensionData Id Name Uid Generate complete snapshot inventory with few details        get-vm | Get-Snapshot Export complete snapshot inventory to csv file get-vm | get-snapshot […]

Read More

Power CLI Command to List Connected Disks to ESXi Hosts

Get connected disk details including name , Multipathing , LunType  of all ESXI HOSTS in vCenter Get-VMHost | Get-ScsiLun -LunType disk User below command to export all the details to CSV Get-VMHost | Get-ScsiLun -LunType disk |export-csv C:\diskinfo.csv Get connected disk details including name , Multipathing , LunType  for Specific ESXI HOST Get-VMHost  “ESXI-TEST.LOCAL.COM” | Get-ScsiLun […]

Read More

Script to List Virtual Machine HW ,VM Tools Version , Tools Status

Below Script will get  virtualmachine hardware version , tools version , Tools status , Tools version status . Connect-VIServer -Server VM-VC.TEST.COM  -User  root -Password ******** Get-VM | Select @{N=”VMName”; E={$_.Name}}, @{N=”HardwareVersion”; E={$_.Extensiondata.Config.Version}}, @{N=”ToolsVersion”; E={$_.Extensiondata.Config.Tools.ToolsVersion}}, @{N=”ToolsStatus”; E={$_.Extensiondata.Summary.Guest.ToolsStatus}}, @{N=”ToolsVersionStatus”; E={$_.Extensiondata.Summary.Guest.ToolsVersionStatus}}, @{N=”ToolsRunningStatus”; E={$_.Extensiondata.Summary.Guest.ToolsRunningStatus}} | Export-Csv  C:\vmdata.csv Output  VMName HardwareVersion ToolsVersion ToolsStatus ToolsVersionStatus ToolsRunningStatus TEST-VM-01 vmx-11 10249 toolsOld guestToolsNeedUpgrade guestToolsRunning TEST-VM-01 […]

Read More