A couple weeks ago I shared part of a script that enables you to separate out the connection to 7-Mode and CDOT controllers.

If you missed that, check it out!

Today I will share the part that expands upon what you can do with the 7-Mode information.

The Code:

Function Get-7ModeInfo {


param ($naCredentials,
       $naController)
    
    if (Get-NASystemVersion) {
        $netAppSystemInfo = Get-NASystemInfo

        Write-Host `n"Controller information (7 Mode)" -ForegroundColor $foregroundColor

        Write-Host   "System Name      : " $netAppSystemInfo.SystemName 
        Write-Host   "System ID        : " $netAppSystemInfo.SystemId
        Write-Host   "System Revision  : " $netAppSystemInfo.SystemRevision 
        Write-Host   "System Serial    : " $NetAppSystemInfo.SystemSerialNumber
    
        Write-Host `n"Partner Information" -ForegroundColor $foregroundColor

        Write-Host   "Partner          : " $netAppSystemInfo.PartnerSystemName 
        Write-Host   "Partner System ID: " $netAppSystemInfo.PartnerSystemId

        Write-Host `n"Options..." -ForegroundColor $foregroundColor
        Write-Host "1. Reset your password"
        Write-Host "2. Search through volumes"
        Write-Host "3. Volume Space Report"
        Write-Host "4. Lun Report"`n
        Write-Host "'q' drops to shell"`n

        $selection = Read-Host "Which #?"
        
        Switch ($selection) {

            1 {
    
                $userName     = $NetAppCredential.UserName 
                $oldPass      = $netAppCredential.Password | ConvertFrom-SecureString        
                $newPassword  = Get-Credential -Message "Enter new password below" -UserName "Doesn't Matter"
                $newdPassword = $newPassword.GetNetworkCredential().Password

                Set-NaUserPassword -User $userName -OldPassword $oldPass -NewPassword $newdPassword
                
                Get-7ModeInfo

            }

            2 {

            }

            3{ 

            Get-NaVol | Select @{Name="VolumeName";Expression={$_.name}},@{Name="TotalSize(GB)";Expression={[math]::Round([decimal]$_.SizeTotal/1gb,2)}},@{Name="AvailableSize(GB)";Expression={[math]::Round([decimal]$_.SizeAvailable/1gb,2)}},@{Name="UsedSize(GB)";Expression={[math]::Round([decimal]$_.SizeUsed/1gb,2)}},@{Name="SnapshotBlocksReserved(GB)";Expression={[math]::Round([decimal]$_.SnapshotBlocksReserved/1gb,2)}},SnapshotPercentReserved,Aggregate,IsDedupeEnabled,type,DiskCount,RaidStatus,Autosize,ChecksumStyle,state | Export-Csv -LiteralPath $Location\$nacontroller.csv -Force -NoTypeInformation -Verbose
            Start-Process .\$nacontroller.csv
            
            Get-7ModeInfo
            
            }

            4{

            Get-NaLun | Select Path,@{Name="TotalSize(GB)";Expression={[math]::Round([decimal]$_.TotalSize/1gb,2)}},@{Name="UsedSize(GB)";Expression={[math]::Round([decimal]$_.SizeUsed/1gb,2)}},Protocol,Online,Thin,Comment | Export-Csv -LiteralPath $Location\$nacontroller"luns".csv -Force -NoTypeInformation -Verbose
            Start-Process .\$nacontroller"luns".csv
            
            Get-7ModeInfo

            }
             
            q {Write-Host "I see 'q', dropping to shell..." -foregroundcolor $foregroundcolor;break}

            }
        }
}

This is very basic and some of the switch options are not even set up yet. I used it as a shell to get some ideas for further administration. Coming up next will will be the same thing but with CDOT commands!

As always, let me know if you have any ideas or comments.