Powershell - Netapp 7-mode offline volumes

$nacred = Import-Clixml D:\Powershell\ps-na-credentials.xml

$nacontrollers = "filers"

foreach ($nacontroller in $nacontrollers)

{

$naconnect = Connect-NaController -Name $nacontroller -Credential $nacred

#Get-NaVol | where State -eq "offline" | select -Property Name,State,OwningVfiler

$volumes = Get-NaVol | where State -eq "offline"

if ($volumes -ne $null) { Write-Host "$($nacontroller):" -ForegroundColor Yellow}

foreach ($volume in $volumes)

{

if ($volume -ne $null) { Write-Host "$($volume.Owningvfiler)@$($naconnect.Name.ToUpper()) volume '$($volume.Name)' is $($volume.State)" }

} # end of foreach volumes

} # end of foreach controllers