Hetfield84
Enthusiast
Enthusiast

Get inaccesible datastores

Jump to solution

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"}

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

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

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

Hetfield84
Enthusiast
Enthusiast

Ah that was it! Thank you very much.

0 Kudos