Data ONTAP PowerShell Toolkit

netapp-logo

The Data ONTAP PowerShell Toolkit is a NetApp developed set of cmdlets for Windows PowerShell that encapsulate many of the APIs available in the NetApp Manage ONTAP® Software Developer’s Kit. These cmdlets let you tap into the power of NetApp APIs to easily perform a wide variety of NetApp specific tasks from within PowerShell scripts. Over 400 cmdlets are available, covering all aspects of NetApp operation.

Data ONTAP PowerShell Toolkit Downloads | Sample Scripts
(Registration needed)

So, OK but what’s in it?
Short answer: 1378 cmdlets to manage and automate operations on your NetApp filer(s)

Wanna see?
Install the toolkit in ‘C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DataONTAP’ and let’s play with it!

Import-Module DataONTAP
Get-Command -Module DataONTAP

Of course, as any PowerShell module, once it’s loaded, is cached until the PowerShell session ends. So, if you had install and imported a previous version of the DataONTAP module, even if you reload the module using Import-Module, you will still work with the module version you’ve loaded initially. In that case you’ll have to import the DataONTAP module using Import-Module with the ‘-force’ switch (or exit your PowerShell session, open a new one and import the module).

Then? then connect to a filer

Connect-NaController -Name yourfilernamegoeshere -HTTPS -Credential (Get-Credential root)

Some basic examples:

  • What is my filer specs?
  • Get-NaSystemInfo
    
  • Display the aggregates infos of the current controller
  • Get-NaAggr
    
  • Display the volumes infos of the current controller
  • Get-NaVol
    
  • Display the LUNs infos of the current controller
  • Get-NaLun
    
  • Display the SnapMirror® relationships properties
  • Get-NaSnapmirror
    
  • And reactivate a broken-off relationship (or force immediate replication) – Replace SOURCE with Controller:Volume
  • Get-NaSnapmirror SOURCE | Invoke-NaSnapmirrorResync
    
  • A last one that can be usefull when working with many filers: on which one am I?
  • $global:CurrentNaController
    

 

Here’s a good “high-level” presentation of the toolkit: https://communities.netapp.com/docs/DOC-6162

By the way, just give it a try and you’ll see how powerfull it is, and usefull to be able to script all the administration tasks you have to do on your filer(s). My only disappointment is with the documentation, too poor. There are not enough usage examples (or not at all for some cmdlets).
Judge it by yourself:

Show-NaHelp

Leave a Reply

Scroll to Top