This tutorial will walk you through installing and configuring the NetApp Data OnTap Powershell Toolkit:
Before you start
Download the Powershell toolkit from the Netapp Community Website. You will need to login with your NOW account to be able to see the download link for the toolkit. The download link will appear in the Spaces panel to the left of the page.
When you click on the download link choose the download named DataONTAP.zip. Once you have the tool kit downloaded you can continue below.
Installing the tool kit
To install the tool kit navigate to where you downloaded the .zip file and unzip it. It should unzip to a folder called DataONTAP. Then you need to take this folder and put it in the PowerShell Modules directory:
Copy this folder to:
The final path should be:
Once you have installed the tool kit you have to import it before you can use it. You can import the tool kit using the Import-Module cmdlet:
Once should suffice to enable you to reference the DataONTAP module from any subsequent session but when writing scripts I always add this reference before I use the tool kit.
Below is a simple example of how to use the tool kit to connect to a NetApp filer and query it for system information. You can either type in line by line into an open PowerShell terminal window or save it in a file and run it.
Connecting to the Filer
$napass = "netapppassword" $password = ConvertTo-SecureString $napass -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "root",$password Connect-NaController $Filer -Credential $cred
Get System info
Bringing it all together
Import-Module DataOnTap $napass = "netapppassword" $password = ConvertTo-SecureString $napass -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "root",$password $filer = "filername" Connect-NaController $Filer -Credential $cred Get-NaSystemInfo
Result of running this script in your Powershell Prompt:
Some items have been removed for security reasons.