Posts

Showing posts from December, 2018

Script to find Datastores with extent

Script to find Datastores with extents This script will help VMware admins to find VMFS datastores with Extents (more than one Lun). Prerequisite:- 1. Supported VMware PowerCLI Version  How To :- 1. Save the code in a .ps1 file. 2.  Run the script in VMware Powercli. 3. It will prompt for the VC name against which it needs to be run, an Esxi name can also be                provided, if it needs to be run against only one Esxi followed by the credentials. 4. Script is tested and safe to run. 5. Result will be saved on the C drive, if you need to save it somewhere else then please modify the last line of the script with the desired path. 6. Out-put of the script will be displayed on screen. 7. Result will only be shown if there are Extents, in case of no Extents output would be empty. Code:- $vc=read-host provide the vCenter Name write-host -foregroundcolor green "Connecting to VC" $vc get-vc $vc $x=get-esxcli -vmhost * $devlist=$x.stora

Script to get WWN and WWPN of hosts

                      Script to get WWN and WWPN of hosts This Script helps VMware admins to gather the WWPN and WWPN of all the ESXi hosts quickly. Prerequisite:- 1. Supported VMware PowerCLI Version 2. CDP should be enabled on Network Switches How To :- 1. Run the script in VMware Powercli. 2. Save the script in .ps1 format. 3. It will prompt for the VC name against which it needs to be run, an Esxi name can also be provided, if it needs to be run against only one Esxi followed by the credentials. 4. Script is tested and safe to run. 5. Result will be saved on the C drive, if you need to save it somewhere else then please modify the last line of the script with the desired path 6. Out-put of the script will be saved in a csv format. Code:- $report=@() $vc=read-host provide the vCenter Name write-host -foregroundcolor green "Connecting to VC/ESXi" $VC get-vc $vc write-host -foregroundcolor green "Gathering

Script to Gather CDP

                               Script to Gather CDP  This script helps VMware admins to gather the CDP report along with the allowed VLANs on each interface(vmnic) Prerequisite:- 1. Supported VMware PowerCLI Version 2. CDP should be enabled on Network Switches. How To :- 1. Run the script in VMware Powercli  2. It will prompt for the VC name against which it needs to be run, an Esxi name can also be                provided, if it needs to be run against only one Esxi followed by the credentials. 3. Script is tested and safe to run. 4. Result will be saved on the C drive, if you need to save it somewhere else then please modify the last line of the script with the desired path. 5. Script will take some time during execution. 6. Out-put of the script will be saved in a csv format. Code:- $vcs=read-host provide the vCenter Name $info=@() foreach($vc in $vcs) { write-host -foregroundcolor green "Connecting to VC/ESXi" $VC g