Connecting to multiple storage systems with the NetApp PowerShell Toolkit


This post discusses methods to connect to multiple NetApp Storage Systems using the NetApp PowerShell Toolkit, and then execute commands against those storage systems


OK, so you’ve setup the NetApp PowerShell Toolkit, and you can connect to a storage system and run some commands. But what if you have more than one storage system?

Conceptual overview

As with all things scripting, there’s many ways to achieve this, but here’s roughly what I’ll be blogging about below:

  1. Gettting a list of storage systems:
    1. Via Text File: Keep an easily-accessible text file up to date with all your storage systems
    2. By enumerating from Active Directory: Query AD to get a list of all your storage systems (providing they’re in AD!)
  2. Setup authentication details for all the storage systems
  3. Connect to the systems and run commands

Getting a list of storage systems

Text file method

This is the simplest and sweetest method, but doesn’t scale too well in a large organisation, so buyer beware 😉

Create a text file in an easily accessible location, such as your home directory or Desktop and populate it with a carriage-returned list of hostnames. For example:

Knowing where the text file is located, we can now setup the base for our PowerShell script:

Now, to see what’s inside the $FilerList array, just type:

You should now see a list of NetApp Storage Systems, like so:

Enumerate from Active Directory

Another way to get a more dynamic list of storage systems is to use an Active Directory lookup

In the example below, all the storage systems are called roughly the same thing. Many organisations have naming schemes, such as: na-site-number (for example, na-cbg-001). If you always call your storage systems the same thing, you can query AD and locate all your filers, like so:

Now, to see what’s inside the $FilerList array, just type:

You should now see a list of NetApp Storage Systems!

Authenticating against multiple storage systems

OK great. Now that we have a list of storage systems, we can use the $FilerList array to authenticate to all the storage systems:

At this point, you’ll be shown a list of all storage systems with authentication credentials stored.

For example:

Running Commands

Now that you’ve got a list of filers inside the $FilerList array and credentials queued up, you can start to run commands against them all using the simple template below. I’ll throw some examples in too, in case it helps:

Putting it all together

Here’s an example of a full script which uses a text file for a list of filers, sets up login credentials, and then runs a few commands against each system.

And finally, here’s an example of the output you’d see:

How was that?

How was that? Let me know in the comments what you’re using it for. I’d love to know! 🙂

By Phil Wiffen

Phil is an IT Professional working in Cambridge, England. He generally blogs about useful solutions that he comes across in his work/play.

2 replies on “Connecting to multiple storage systems with the NetApp PowerShell Toolkit”

This is awesome Phil thank you. How do I use it without having to enter credentials at all? i.e. store the credential in the script or a more secure manner?

Leave a Reply

Your e-mail address will not be published. Required fields are marked *