Sumedh

How to execute commands on filer using windows Powershell with Data Ontap module




Published - Sep 15/2011
Last Updated - Sep 15/2011
Author - Sumedh






This guide will show you how to install Dataontap Module for Powershell, connect to a filer and execute commands. If you are using Windows XP, 2003, Vista (32 bit or 64 bit versions) you will need to download Microsoft Windows Management Framework Core package which has Powershell 2.0 from here.

If you are using Windows 7, Windows Server 2008 R2 or 2k8 R2 core, powershell 2.0 is already installed, you don't have to download anything.

Note - Powershell cannot be isntalled on Windows Server 2008

Download Netapp Data ONTAP Powershell Toolkit from Netapp Community Site (You will need NOW access)

Download DataONTAP.zip ( I am using version 1.5), extract the files and place the module contents in C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DataONTAP

You need to place the extracted files in the right place, check the screenshot for more details
Note - Your Path may be different.





Start Powershell and execute "$host.version" (without the quotes). It should show Major version 2.0




Execute the following commands
Set-ExecutionPolicy unrestricted
Import-module DataOnTap
get-module

Note - The "get-module" command should display the imported modules in Powershell.



The first command given below will use your default login credentials. The second command will display a pop up which asks for the password, after the command is sucessful you should see Name, Address, Version etc about the filer.

connect-NaController FILER_NAME
OR
connect-NaController filer_name -cred administrator



Display System Version
get-NaSystemversion


Display Volume List
get-navol


Sort volumes on filer based on size
get-navol | sort-object TotalSize


For more information on ntap powershell, cmdlets visit media.netapp.com