Microsoft Virtualization Discussions

read from multiple filers

JSHACHER11
6,446 Views

I am after a script that will provide data from multiple filers

I can use this:

Get-NaVol -Controller (get-content c:\filers.txt)

The problem is that each filer in that list has different credentials. Is there a way to store the credentials in a file and somehow let PoSh read it?

something like:

Connect-NaController -Name (get-content c:\filers.txt) -Credential (get-content c:\credentials.txt)

Thank you

Joel

1 ACCEPTED SOLUTION

beam
6,444 Views

The Toolkit provides cmdlets for storing credentials.  Check out the following cmdlets:

PS C:\> help *NaCredential

Name                              Category  Synopsis

----                              --------  --------

Add-NaCredential                  Cmdlet    Save login credentials for a Data ONTAP controller.

Get-NaCredential                  Cmdlet    List entries in the credentials cache.

Remove-NaCredential               Cmdlet    Remove saved login credentials for a Data ONTAP controller.

Connect-NaController and Connect-NcController will automatically use the credentials cache.  For example, we can add the credentials for 10.61.169.28, then use Connect-NaController to connect without having to provide credentials:

PS C:\> Get-NaCredential 10.61.169.28

PS C:\> Add-NaCredential 10.61.169.28 -Credential root

Name                                    Credential                              HostUser

----                                    ----------                              --------

10.61.169.28                            System.Management.Automation.PSCrede...

PS C:\> Connect-NaController 10.61.169.28

Name                 Address           Ontapi   Version

----                 -------           ------   -------

10.61.169.28         10.61.169.28      1.13     NetApp Release 8.0.1 7-Mode: Wed Jan  5 17:24:41 PST 2011

-Steven

View solution in original post

11 REPLIES 11
Public