<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Netapp Powershell Report Script for Systeminfo in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161236#M6269</link>
    <description>&lt;P&gt;hey thanks&lt;/P&gt;
&lt;P&gt;that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i'm struggling now with the 2én&amp;nbsp; loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$clusters = "cl01" ,"cl02"

foreach($cluster in $clusters)
{

Connect-NcController $cluster -Credential $ControllerCredential
[System.Array]$Nodes = Get-NcNode

$myCol = @()
Foreach($Node in $Nodes){
$x = "" | Select Cluster,ClusterIP,Node,NodeIP,Location, NodeSerialNumber,NodeSystemId,Model,Version

$x.Cluster = $Node.ncController.Name
$x.ClusterIP = $Node.ncController.Address
$x.Node = $Node.Node
$x.NodeIP = Get-NcNetInterface -Role node_mgmt | ? HomeNode -eq $node.Node | select -ExpandProperty address
$x.model = $Node.NodeModel
$x.Location = $Node.NodeLocation
$x.NodeSerialNumber = $Node.NodeSerialNumber
$x.NodeSystemId = $Node.NodeSystemId
$x.Version = $Node.ProductVersion.Split(":")[0]

}
$mycol += $x


}
$mycol&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 17 Nov 2020 15:46:36 GMT</pubDate>
    <dc:creator>sudoline</dc:creator>
    <dc:date>2020-11-17T15:46:36Z</dc:date>
    <item>
      <title>Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161229#M6267</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help for a powershell script. I like to do a report for some Netapp Clusters to receive Information about Name,Ip,Location, Nodes, Nodes IP mgmt ip , aso. and all helpfull stuff&lt;/P&gt;
&lt;P&gt;How can I extract this data, and the best way would be to do this in a biger foreach loop with multible clusters..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$myCol = @()&lt;/P&gt;
&lt;P&gt;Connect-NaController $clusters -Credential $ControllerCredential&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;[System.Array]$Nodes = Get-NcNode&lt;BR /&gt;Foreach($Node in $Nodes){&lt;BR /&gt;&lt;BR /&gt;$x = "" | Select Node,Model,NodeSerialNumber,NodeSystemId,Version,IP&lt;/P&gt;
&lt;P&gt;$x.Node = $Node.Node&lt;BR /&gt;$x.model = $Node.NodeModel&lt;BR /&gt;$x.NodeSerialNumber = $Node.NodeSerialNumber&lt;BR /&gt;$x.NodeSystemId = $Node.NodeSystemId&lt;BR /&gt;$x.Version = $Node.ProductVersion.Split(":")[0]&lt;BR /&gt;$x.IP = $Node | Get-NcNetInterface -Role node_mgmt | select Address&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;$mycol += $x&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$mycol&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 13:15:23 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161229#M6267</guid>
      <dc:creator>sudoline</dc:creator>
      <dc:date>2020-11-17T13:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161235#M6268</link>
      <description>&lt;P&gt;Yep, that is basically how I would do it for multiple clusters (just another foreach loop that will loop through all nodes in all clusters). If you have huge clusters with a lot of nodes, you may want to look into the -Query parameter for Get-NcNode, which can help limit the amount of properties that you collect (since you are filtering it with Select-Object later in the code anyways) and should help your code run faster.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I ran your code in my lab, the line that returns the node management interface returned the IPs of all the node's node-mgmt IPs for each entry in the output, so I rewrote it - other than that, everything looks like it worked as expected!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$myCol = @()
Connect-NcController $clusters -Credential $ControllerCredential
[System.Array]$Nodes = Get-NcNode

Foreach($Node in $Nodes){
$x = "" | Select Node,Model,NodeSerialNumber,NodeSystemId,Version,IP

$x.Node = $Node.Node
$x.model = $Node.NodeModel
$x.NodeSerialNumber = $Node.NodeSerialNumber
$x.NodeSystemId = $Node.NodeSystemId
$x.Version = $Node.ProductVersion.Split(":")[0]
$x.IP = Get-NcNetInterface -Role node_mgmt | ? HomeNode -eq $node.Node | select Address
$mycol += $x
}

$mycol&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to how to extract it, you could export the data to a CSV with Export-Csv, format the output as a table (or HTML, or an email attachment) and send it with Send-MailMessage. Lots of options there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:01:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161235#M6268</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-11-17T15:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161236#M6269</link>
      <description>&lt;P&gt;hey thanks&lt;/P&gt;
&lt;P&gt;that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i'm struggling now with the 2én&amp;nbsp; loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$clusters = "cl01" ,"cl02"

foreach($cluster in $clusters)
{

Connect-NcController $cluster -Credential $ControllerCredential
[System.Array]$Nodes = Get-NcNode

$myCol = @()
Foreach($Node in $Nodes){
$x = "" | Select Cluster,ClusterIP,Node,NodeIP,Location, NodeSerialNumber,NodeSystemId,Model,Version

$x.Cluster = $Node.ncController.Name
$x.ClusterIP = $Node.ncController.Address
$x.Node = $Node.Node
$x.NodeIP = Get-NcNetInterface -Role node_mgmt | ? HomeNode -eq $node.Node | select -ExpandProperty address
$x.model = $Node.NodeModel
$x.Location = $Node.NodeLocation
$x.NodeSerialNumber = $Node.NodeSerialNumber
$x.NodeSystemId = $Node.NodeSystemId
$x.Version = $Node.ProductVersion.Split(":")[0]

}
$mycol += $x


}
$mycol&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:46:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161236#M6269</guid>
      <dc:creator>sudoline</dc:creator>
      <dc:date>2020-11-17T15:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161237#M6270</link>
      <description>&lt;P&gt;You have the creation of the empty array inside the foreach loop so it is re-creating it each time it loops:&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;$myCol = @()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you move it outside of the loop (to the 2nd line of your code, for example) the output will look better.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:03:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161237#M6270</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-11-17T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161240#M6271</link>
      <description>&lt;P&gt;yeh you right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do you know how to pimp the script and get more information for each node like&lt;/P&gt;
&lt;P&gt;dns settings&lt;/P&gt;
&lt;P&gt;gateway&lt;/P&gt;
&lt;P&gt;lifs&lt;/P&gt;
&lt;P&gt;aggregates&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:30:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161240#M6271</guid>
      <dc:creator>sudoline</dc:creator>
      <dc:date>2020-11-17T16:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161241#M6272</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First notice that you are using both the NA and NC cmdlets, is you using ONTAP 9/Cluster mode, use NC only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now to fully enjoy the power of PowerShell I would try to avoid recreating new objects, and avoid loops where I can, this allows PowerShell to do it's magic, and use parallelism when issuing a command (depend on the developer of the cmdlet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way I did the same script:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;$ControllerCredential = Get-Credential
$clustersNames = 'cluster1','cluster2' 
$clustersObj = connect-NcController $clustersNames -Credential $ControllerCredential
$MgmtLifObj = Get-NcNetInterface -Controller $clustersObj -Role node_mgmt
$NodesObj = Get-NcNode -Controller $clustersObj
$NodesObj | select Node,Model,NodeSerialNumber,NodeSystemId,Version,@{Label="IP";expression={($MgmtLifObj | ? CurrentNode -eq $_.Node).Address}} | ft 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just for fun I run both scripts for one cluster in Measure-command {....} | ft TotalMilliseconds . The version above did it in 620 Mill, and the one you provided in 733. Not a big difference and I don't know what exactly took there longer (running Get-NcNetInterface twice, building new arrays etc) - but was interesting to check before I commented here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To be honest, I might have taken two different approaches altogether.&lt;/P&gt;
&lt;P&gt;1. try to use ONTAP rest API instead of the PS Module, I didn't see NetApp saying it yet - but I think that will be the standard way going forward, and learning how to fiddle with raw rest API's (in any scripting language) will do very good for your general non-vendor-specific skillset, and technically allow you to use more standardized tools and deployment environments where the ONTAP PS Module cannot be installed (Containers, PS for Linux, CI/CD tools).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. if you have OCUM/AIUM - use that rest API for faster results (as it's already stores all the clusters data), and a bit more safe as you reading read-only source rather a production cluster .&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.netapp.com/ocum-97/index.jsp?topic=%2Fcom.netapp.doc.onc-um-api-dev%2FGUID-6C4A78C2-9F22-4723-B190-FA227CD067FD.html&amp;amp;cp=2_4_2_0" target="_blank"&gt;https://docs.netapp.com/ocum-97/index.jsp?topic=%2Fcom.netapp.doc.onc-um-api-dev%2FGUID-6C4A78C2-9F22-4723-B190-FA227CD067FD.html&amp;amp;cp=2_4_2_0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:40:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161241#M6272</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2020-11-17T16:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161242#M6273</link>
      <description>&lt;P&gt;&lt;STRONG&gt;DNS settings:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is per-SVM - Use "Get-NcNetDns"&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Gateway:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Use "Get-NcNetRoute"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;LIFs:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;"Get-NcNetInterface" will return lots of LIF information&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Aggregates:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;"Get-NcAggr"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may already know this, but just in case someone else takes a look at this thread, here are two commands/tricks that are super useful when looking for new cmdlets or trying to get very specific data from them:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Get-Member&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can pipe a command to Get-Member to see all of the available properties that are returned by the cmdlet. This helps if you want to set up a query or a select statement to only return relevant data.&lt;/P&gt;
&lt;P&gt;2. Get-Command&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I'm searching through a giant module (like the PSTK with 2300+ cmdlets) to see if I can get a particular piece of data from it, I will use something like "Get-Command -Module DataONTAP -Name *route*" to get an idea if there are commands that might be a good fit for what I'm looking for and at least help me narrow the search.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 16:42:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/161242#M6273</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-11-17T16:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/170049#M6452</link>
      <description>&lt;P&gt;I have modified the script a little bit and make it working!!!&lt;/P&gt;&lt;P&gt;#Get-NetAppSystemInfo2.ps1&lt;BR /&gt;$ControllerCredential = Get-Credential&lt;BR /&gt;$clusters = 'cluster01',''cluster02',''cluster03',''cluster04'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$myCol = @()&lt;BR /&gt;foreach($cluster in $clusters)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Connect-NcController $cluster -Credential $ControllerCredential&lt;BR /&gt;[System.Array]$Nodes = Get-NcNode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Foreach($Node in $Nodes){&lt;/P&gt;&lt;P&gt;$x = "" | Select Cluster,ClusterIP,Node,NodeIP,Location, NodeSerialNumber,NodeSystemId,Model,Version&lt;/P&gt;&lt;P&gt;$x.Cluster = $Node.ncController.Name&lt;BR /&gt;$x.ClusterIP = $Node.ncController.Address&lt;BR /&gt;$x.Node = $Node.Node&lt;BR /&gt;$x.NodeIP = Get-NcNetInterface -Role node_mgmt | ? HomeNode -eq $node.Node | select -ExpandProperty address&lt;BR /&gt;$x.model = $Node.NodeModel&lt;BR /&gt;$x.Location = $Node.NodeLocation&lt;BR /&gt;$x.NodeSerialNumber = $Node.NodeSerialNumber&lt;BR /&gt;$x.NodeSystemId = $Node.NodeSystemId&lt;BR /&gt;$x.Version = $Node.ProductVersion.Split(":")[0]&lt;BR /&gt;$mycol += $x&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;$mycol&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 02:01:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/170049#M6452</guid>
      <dc:creator>James_BGRS</dc:creator>
      <dc:date>2021-09-17T02:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Netapp Powershell Report Script for Systeminfo</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/457260#M7016</link>
      <description>&lt;P&gt;James, the script error at&amp;nbsp;&lt;/P&gt;&lt;P&gt;} | Select-Object Name, Volume, Created, "Total "&lt;BR /&gt;Get-NcSnapshot : The remote server returned an error: (400) Bad Request.&lt;BR /&gt;At line:2 char:14&lt;BR /&gt;+ $snapshots = Get-NcSnapshot | Select-Object Name, Volume, Created, To ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [Get-NcSnapshot], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : System.Net.WebException,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.GetNcSnapshot&lt;BR /&gt;&lt;BR /&gt;Add-Member : Cannot bind argument to parameter 'InputObject' because it is null.&lt;BR /&gt;At line:27 char:6&lt;BR /&gt;+ $_ | Add-Member -MemberType NoteProperty -Name "Total " -Value (Conve ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException&lt;BR /&gt;+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 09:04:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Netapp-Powershell-Report-Script-for-Systeminfo/m-p/457260#M7016</guid>
      <dc:creator>manistorage</dc:creator>
      <dc:date>2024-12-10T09:04:08Z</dc:date>
    </item>
  </channel>
</rss>

