This post will just go over the basics to get your connected to your NetApp FAS2650 device via PowerShell and run some simple commands.
Download the NetApp PowerShell Toolkit from here
Once it has been installed open your PowerShell ISE and import the NetApp module:
Import-Module DataONTAP
Run the below command to connect to your controller (I used the IP address of the OnCommand System Manager):
Connect-NaController -Name 10.5.0.100 -HTTPS -Credential (Get-Credential root)
To start with run a basic command to see if you are connected properly, this will output your aggregate information:
Get-NcAggr
You can also use the below commands:
Get-NcLun
Get-NcVol
Run the below for a full command listing:
get-nchelp
Get-NcVolSpace
Get-NcVMInfo -Node san_node_1
Get-NcDisk
If you want to add the NetApp login credentials in a script and load the module you can enter this as below:
$Username = 'user' $Password = 'pass' $pass = ConvertTo-SecureString -AsPlainText $Password -Force $SecureString = $pass # Users you password securly $MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString Import-Module DataONTAP Connect-NaController -Name 10.5.0.10 -HTTPS -Credential $MySecureCreds