VMware Cloud Community
Hetfield84
Enthusiast
Enthusiast
Jump to solution

Get inaccesible datastores

Hi,

I'm trying to get a list of all datastores that are inaccessible. Below is what I have tried, but it returns nothing. I know we have a few in our environment, what am I missing?

$dStore = get-view -viewtype Datastore -Property Name, Summary | where {$_.ExtensionData.Summary.Accessible -eq "False"}

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

When you use Get-View, you get vSphere objects, not .NET objects.
The Extensiondata part is not needed.

$dStore = get-view -viewtype Datastore -Property Name, Summary | where {$_.Summary.Accessible -eq $false}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

When you use Get-View, you get vSphere objects, not .NET objects.
The Extensiondata part is not needed.

$dStore = get-view -viewtype Datastore -Property Name, Summary | where {$_.Summary.Accessible -eq $false}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Hetfield84
Enthusiast
Enthusiast
Jump to solution

Ah that was it! Thank you very much.

Reply
0 Kudos