Installing and configuring the NetApp Data OnTap Powershell Toolkit

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.

Download Link for Netapp Powershell Toolkit

Download Link for Netapp Powershell Toolkit

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:

C:\Windows\System32\WindowsPowerShell\v1.0\Modules

The final path should be:

C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DataONTAP
DataontapLocation

Saving the DataONTAP module to the PowerShell modules directory.

Configuration

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:

Import-Module DataOnTap

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.

[adsense]

Simple Example

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

Get-NaSystemInfo

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

Console Output

Result of running this script in your Powershell Prompt:

Output of PowerShell script showing system information.

Output of Powershell script showing system information.

Some items have been removed for security reasons.

If you want to find out your Snapmirror status take a look at this post or for Snapvault status this post.

This was installing and configuring the NetApp Data OnTap PowerShell Toolkit on Thoughts.
Subscribe to my feed either by E-mail or by RSS to receive updates as they happen.

  • Thanks v much, worked perfectly for me

    • Great James. I’m glad it worked for you. The article is a few years old now so it good that it is still relevant.