I tried below
Hello
http://ict-freak.nl/2011/01/01/powercli-easy-nfs-datastore-setup/
$REFHOST = Get-VMHost "myhost.*"
foreach($nfs in (Get-VMhost $REFHOST | Get-Datastore | Where {$_.type -eq "NFS"} | Get-View)){
$share = $nfs.Summary.Url
$share = $share.Replace("//","/")
$share = $share.TrimStart("netfs:/")
if($share -match "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"){
$ip = $matches[0]
}
$remotePath = $share.Trim("$ip")
$remoteHost = $ip
$shareName = $nfs.Name
Write-Host "NFS Share info: `nPath: $($remotePath) `nHost: $($remoteHost) `nShare: $($shareName) `n"
}
But i do not get the details for some reasons.
Also i wanted a xls.
This is what i am looking for :
Filer name/IP
Filer export
Mount name
Kindly guide.
==
Even other script does not get me all 3 above
$report = @()
Get-Datastore | where {$_.type -eq "NFS"} | Get-View | %{
$ds = $_
$_.Host | %{
$row = "" | Select NFSHost, Path, Capacity, Free, ESXHost, Cluster
$row.NFSHost = $ds.Info.Nas.RemoteHost
$row.Path = $ds.Info.Nas.RemotePath
$row.Capacity = $ds.Info.Nas.Capacity
$row.Free = $ds.Info.FreeSpace
$row.ESXHost = (Get-View $_.Key).Name
$row.Cluster = (Get-Cluster | where {$_ | Get-VMHost | where {$_.Name -eq $row.ESXHost}}).Name
$report += $row
}
}
$report
In essense i am looking for o/p of
~ # esxcfg-nas -l, in xls.
Also it should visit each cluster & do get-vmhost |get-random ... ie 1 host in each cluster