Posts tagged ‘netapp powershell gettingstarted’

NetApp PowerShell Toolkit: Getting Started

Welcome! I am in the process of learning PowerShell and more specifically the NetApp PowerShell Toolkit. I’ll post one-liners, simple scripts, tips, and resources I discover along the way. If you are a NetApp storage administrator and you haven’t taken the NetApp PowerShell Toolkit for a spin yet, I highly recommend you do so. The PowerShell language combined with the Data ONTAP API is a powerful tool that can be used to document, manipulate and even automate your storage environment.

Getting setup with NetApp’s PowerShell Toolkit is very simple. More info can be found here. You will need to login to download the DataONTAP.msi installer.

Once you get the toolkit installed properly, you should be able to type “Get-NaHelp” to see a list of NetApp commandlets.

The first few lines of the Get-NaHelp command should look something like this:


PS C:\Scripts> Get-NaHelp

Name                                Category        Api
----                                --------        ---
Add-NaAggr                          aggr            {aggr-add}
Add-NaCifsShare                     cifs            {cifs-share-add}
Add-NaCredential                    toolkit
Add-NaFpolicyExtension              fpolicy         {fpolicy-extensions}
...

All of the NetApp commandlets are in the format “Verb-NaNoun” for 7-Mode and “Verb-NcNoun” for Clustered ONTAP.

To get help with a specific commandlet use the standard Microsoft “Get-Help” commandlet followed by the NetApp commandlet:


PS C:\Scripts> Get-Help Get-NaVol

NAME
    Get-NaVol

SYNOPSIS
    Get volume status.

SYNTAX
    Get-NaVol [[-Names] <String[]>] [-Aggregate <String>] [-Terse] [-Controller <NaController>] [<CommonParameters>]

DESCRIPTION
    Get volume status.  Note that all RAID-related status items (e.g., 'raid-size', 'raid-status', 'checksum-style')
    reported for a flexible volume actually describe the state of its containing aggregate.

RELATED LINKS

REMARKS
    To see the examples, type: "get-help Get-NaVol -examples".
    For more information, type: "get-help Get-NaVol -detailed".
    For technical information, type: "get-help Get-NaVol -full".

Most of the commandlets require you to first connect to a NetApp controller using the “Connect-NaController” commandlet:


PS C:\Scripts> Connect-NaController 192.168.150.98

Name                 Address           Ontapi   Version
----                 -------           ------   -------
netapp1              192.168.150.98    1.14     NetApp Release 7.3.6: Thu Jul  7 02:02:45 PDT 2011

Hopefully that is enough info to get you started if you are completely new to the NetApp Toolkit. If not, feel free to ask for help in the comments or on the NetApp Communities website.

Subscribe via RSS or follow me on Twitter (@seanluce) for updates.

Happy Scripting!