There are multiple ways to do authentication to NetApp systems when using the PowerShell Toolkit. This ranges from the simple and obvious one-time connection, to securely storing credentials for future use. Saving credentials can be useful when executing scripts from a host non-interactively, such as with scheduled tasks or triggered through another script.
Connecting to a Single Controller
The Connect-NcController
is the standard method of connecting to a clustered Data ONTAP controller. Connect-NaController
is the 7-mode equivalent and works identically. Additionally, the same credential rules apply for the Invoke-NcSsh
and Invoke-NaSsh
cmdlets as well.
Arguably the most common method of connecting to a controller is by simply providing the hostname:
1 2 3 |
# this will attempt to connect to the specified controller using stored credentials, or if none # are found, will prompt for credentials. it will also default to HTTPS, with a fallback to HTTP Connect-NcController $myController |
If you are connecting to an SVM’s management interface this will work as expected, though some cmdlets won’t work because of the limited scope. If you want to connect to an SVM by tunneling through the cluster management interface, use the -Vserver
parameter.
1 |
Connect-NcController $clusterMgmtLif -Vserver $SvmName |
However, there are a number of parameters which change the default behavior.