Microsoft Virtualization Discussions

Playing around with get-nadisk to pull volume information

JGPSHNTAP
5,572 Views

So, i'm at it again... Just playing around and thinking of things I can mess around with and we ran across an issue where we had specific shelf issues in our environment and I wanted to know immediately what volumes were affected.

Yah, I can go to my autosupports and backtrack through aggregates, but that's not fun...

So, I'm just messing around with a simple query on the disk but i'm having trouble getting the entire picture...

Here's where i'm at so far..

$hosts = @("filer1a","filer1b")

$hosts | % {

Write-host Connecting to Filer: $_

$c  = connect-nacontroller $_

$shelf = get-nadisk | ? {($_.name -like "*1b*" -or $_.name -like "*2b*") -and $_.shelf -eq "3" -and $_.aggregate -ne $null}

$shelf | Ft -groupby @{E ={$C};Label="Filer"} -autosize

}

Tthat will give me a clear picture of which filer owns the disks on channel 1b/2b shelf 3, but I want to turn this into what volumes are part of this...   My powershell skills are just not taking me to where I need to be at this moment, but i'm giving it a shot.

I know the get-nadisk has an aggregate property and I planned on looping that into this

get-navol -aggregate $_.aggregate,  but i'm having trouble putting it all together..

I need to understand that $shelf should have all the properties and why can't I just do something like $shelf.aggregate.  

Can someone point me in the right direction...

Thanks

10 REPLIES 10
Public