Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Loop through each Nimble group
- foreach ($nimbleGroup in $nimbleGroups)
- {
- # Connect to current Nimble Group in loop
- try
- {
- $null = Connect-NSGroup -Group $nimbleGroup -Credential $StorageCreds -IgnoreServerCertificate -ErrorAction Stop
- }
- catch
- {
- $err = $_;
- Write-Warning "Failed to login or connect to $($nimbleGroup) over port TCP 5392: $($err.exception.message)`n`r"
- continue
- }
- # Get all Nimble Arrays in group
- $NimbleArrays = Get-NSArray
- # Loop through each Nimble in group
- foreach ($nimbleArray in $nimbleArrays)
- {
- Get-NSArray -Name $nimbleArray.Name | Select-Object `
- @{Name = 'Name'; Expression = {$_.Name}},
- @{Name = 'Model'; Expression = {"Nimble $($_.Model)"}},
- @{Name = 'Firmware'; Expression = {$_.Version}},
- @{Name = 'Used Storage'; Expression = {[Math]::Round(($_.usage / 1TB),2)}},
- @{Name = 'Total Usable Storage'; Expression = {[Math]::Round((((($_.usable_capacity_bytes - ($_.usable_capacity_bytes * .15)) - $_.usage) / 1TB)),2)}},
- @{Name = 'Total Free Storage'; Expression = {[Math]::Round(($_.available_bytes / 1TB),2)}},
- @{Name = 'Total Storage'; Expression = {[Math]::Round(($_.usable_capacity_bytes / 1TB),2)}},
- @{Name = 'Clusters Connected'; Expression = {'N/A'}}
- }
- #Disconnect from current Nimble Group in loop
- Disconnect-NSGroup
- }
- <# OUTPUT
- Successfully connected to array wtm-nimble02
- Name : NimbleName###
- Model : Nimble AF####
- Firmware : 4.5.2.0-553085-opt
- Used Storage : #.##
- Total Usable Storage : #.##
- Total Free Storage : #.#
- Total Storage : ##.##
- Clusters Connected : N/A
- #> OUTPUT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement