Microsoft Virtualization Discussions

Create Sysinfo Files for Multiple Filers

CPLECLERCQ

Hello,

we just want to get daily Sysinfo-File from multiple filers.

I started with this

foreach ($filer in Get-Content e:\dfsbackup\Netapp\filers.txt) { Connect-NaController -Name $filer;

Get-NaSystemInfo

Get-NaOption

Get-NaNetActiveConfig 

Get-NaNetInterface

Get-NaNetVif

Get-NaNetRoute

Get-NaNetVlan

Get-NaVol

Get-NaCifsShare

Get-NaSnapmirror 

Get-NaNfsExport }

Out-File e:\dfsbackup\Netapp\ <-- and here is my Problem !

I want a file for each filer and every day.

I try a lot but I think something is blocking me .

Thanks for any advise

Claus

1 ACCEPTED SOLUTION

sizemore

Hey Claus,

How about something like.. .

$outputFolder = "e:\dfsbackup\Netapp"            
foreach ($filer in Get-Content e:\dfsbackup\Netapp\filers.txt)             
{            
    $file = "{0}\{1}_{2}" -f $outputFolder, $filer, (Get-Date -UFormat "%d%h%y")            
    Connect-NaController -Name $filer            
            
    Get-NaSystemInfo | Out-File -FilePath $file -Encoding ascii            
    Get-NaOption | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetActiveConfig  | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetInterface | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetVif | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetRoute | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetVlan | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaVol | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaCifsShare| Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaSnapmirror  | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNfsExport | Out-File -Append -FilePath $file -Encoding ascii            
}

~Glenn

View solution in original post

4 REPLIES 4

sizemore

Hey Claus,

How about something like.. .

$outputFolder = "e:\dfsbackup\Netapp"            
foreach ($filer in Get-Content e:\dfsbackup\Netapp\filers.txt)             
{            
    $file = "{0}\{1}_{2}" -f $outputFolder, $filer, (Get-Date -UFormat "%d%h%y")            
    Connect-NaController -Name $filer            
            
    Get-NaSystemInfo | Out-File -FilePath $file -Encoding ascii            
    Get-NaOption | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetActiveConfig  | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetInterface | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetVif | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetRoute | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNetVlan | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaVol | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaCifsShare| Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaSnapmirror  | Out-File -Append -FilePath $file -Encoding ascii            
    Get-NaNfsExport | Out-File -Append -FilePath $file -Encoding ascii            
}

~Glenn

View solution in original post

CPLECLERCQ

Thanks

looks better .

But I got this error message:

At C:\Users\axxxxxx\AppData\Local\Temp\2\8e4faf37-77ca-4563-9bde-4b94f2751fc2.ps1:7 char:32

+ Get-NaSystemInfo | Out-File <<<< -FilePath $file -Encoding ascii

+ CategoryInfo : OpenError: (:) [Out-File], NotSupportedException

+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

For each command.

Any Ideas ?

Claus

sizemore

Hey Claus,


Try it now there was a bug in the filename generation.

~Glenn

CPLECLERCQ

Great THX It works

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public