VMware Cloud Community
broedi
Contributor
Contributor

How to find ReadOnly Datastores?

Hi,

is there a way to find ReadOnly mounted NFS-Datastores by using PowerCLI?

Best regards,

Broedi

0 Kudos
1 Reply
LucD
Leadership
Leadership

Yes, something like this

foreach($ds in (Get-Datastore | where {$_.Type -eq "NFS"})){
    $ds.Extensiondata.Host | Select @{N="DSname";E={$ds.Name}},
            @{N="EsxName";E={(Get-View $_.Key).Name}},
            @{N="Read-Only";E={$_.MountInfo.AccessMode}}
}


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

0 Kudos