Please enable Javascript for better experience...
PowerCli script to scan DeadLun path in Vcenter
By Jitendra | Jul 26, 2017 | In Articles | Total Views [ 84 ]
Taged In
(0 Like)
Rate

Scanning the deadLun Path in Vcenter

 

# PowerShell script to check for VM snapshots and send Email report

 

add-pssnapin VMware.VimAutomation.Core

Connect-VIServer -Server 'vmwarediaryVcenter' -User 'vmwarediary\rahulJ' -Password 'abc@1234567'

 

 

 

ForEach ($vmhost in (Get-Datacenter | Get-Vmhost | Sort)){ $deadpaths = Get-ScsiLun -vmhost $vmhost | Get-ScsiLunPath | where {$_.State -eq "Dead"} | Select ScsiLun,State; Write-Host $vmhost

$deadpaths} ConvertTo-Html Host, Deadpaths | set-Content "c:\test.htm"

 

Result would be as below:

 

{ScsiLun=naa.30001440000000103039d8bac5ee8099; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8099; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8099; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8098; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee809b; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee7f37; State=Dead} @{ScsiLun=naa.30001440000000103039d8bac5ee8093; State=Dead}

 

Share this

About the Author

Jitendra
Jitendra
Contributer VMwareDiary.com

User's Comments


 
Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Comment