<?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: New-NcClusterLogForward generating a StackOverflowException in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/New-NcClusterLogForward-generating-a-StackOverflowException/m-p/134373#M5481</link>
    <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not certain what would be causing the cmdlet to crash your powershell session but here is a workaround by invoking the ZAPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#'------------------------------------------------------------------------------
Param(
   [Parameter(Mandatory=$True, HelpMessage="The cluster to connect to")]   
   [String]$Cluster,
   [Parameter(Mandatory=$True, HelpMessage="The credentials for the cluster")]   
   [System.Management.Automation.PSCredential]$Credentials
)
Import-Module DataONTAP
Connect-NcController -Name $Cluster -HTTPS -Credential $Credentials
$request = New-Object "System.Xml.XmlDocument"
$request.LoadXml("&amp;lt;cluster-log-forward-create&amp;gt;
                     &amp;lt;destination&amp;gt;wfa.testlab.local&amp;lt;/destination&amp;gt;
                     &amp;lt;facility&amp;gt;user&amp;lt;/facility&amp;gt;
                     &amp;lt;force&amp;gt;false&amp;lt;/force&amp;gt;
                     &amp;lt;port&amp;gt;514&amp;lt;/port&amp;gt;
                     &amp;lt;protocol&amp;gt;udp-unencrypted&amp;lt;/protocol&amp;gt;
                     &amp;lt;return-record&amp;gt;true&amp;lt;/return-record&amp;gt;
                     &amp;lt;verify-server&amp;gt;false&amp;lt;/verify-server&amp;gt;
                  &amp;lt;/cluster-log-forward-create&amp;gt;")
Write-Host "Invoking the 'cluster-log-forward-create' ZAPI"                 
$request.'cluster-log-forward-create'
$response = Invoke-NcSystemApi $request
$response.results."cluster-log-forward-info"
#'------------------------------------------------------------------------------&lt;/PRE&gt;&lt;P&gt;Here is an example usage:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PS C:\Scripts\PowerShell\Projects\CreateClusterLogFoward&amp;gt; .\CreateClusterLogFoward.ps1 -Cluster cluster2.testlab.local -Credentials $credentials

Name                 Address           Vserver              Version
----                 -------           -------              -------
cluster2.testlab.... 192.168.100.3                          NetApp Release 9.1: Thu Dec 22 23:05:58 UTC 2016
Invoking the 'cluster-log-forward-create' ZAPI

destination   : wfa.testlab.local
facility      : user
force         : false
port          : 514
protocol      : udp-unencrypted
return-record : true
verify-server : false&lt;/PRE&gt;&lt;P&gt;And from the CLI it now shows the cluster log foward configuration:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cluster2::&amp;gt; cluster log-forwarding show

                                                Verify  Syslog
Destination Host         Port   Protocol        Server  Facility
------------------------ ------ --------------- ------  --------
wfa.testlab.local        514    udp-unencrypted false   user&lt;/PRE&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
    <pubDate>Mon, 11 Sep 2017 06:41:18 GMT</pubDate>
    <dc:creator>mbeattie</dc:creator>
    <dc:date>2017-09-11T06:41:18Z</dc:date>
    <item>
      <title>New-NcClusterLogForward generating a StackOverflowException</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/New-NcClusterLogForward-generating-a-StackOverflowException/m-p/134336#M5480</link>
      <description>&lt;P&gt;The following is what I am getting when using the New-NcClusterLogForward cmdlet. I am using version 4.4 of PowerShell Toolkit. The cluster is ONTAP 9.2 vSIM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a workaround or a fix for this issue that I can implement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PS C:\Users\chrisj1&amp;gt; import-module dataontap
PS C:\Users\chrisj1&amp;gt; Connect-NcController -Name cj-cluster01.sydlab.netapp.au -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential

Name                 Address           Vserver              Version
----                 -------           -------              -------
cj-cluster01.sydl... 10.128.57.242                          NetApp Release 9.2: Mon Jun 19 22:20:04 UTC 2017


PS C:\Users\chrisj1&amp;gt; New-NcClusterLogForward -destination git.sydlab.netapp.au -port 514
WARNING: WriteObject: object has no NcController field.

Process is terminated due to StackOverflowException.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 14:37:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/New-NcClusterLogForward-generating-a-StackOverflowException/m-p/134336#M5480</guid>
      <dc:creator>Chris_Jones</dc:creator>
      <dc:date>2025-06-04T14:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: New-NcClusterLogForward generating a StackOverflowException</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/New-NcClusterLogForward-generating-a-StackOverflowException/m-p/134373#M5481</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not certain what would be causing the cmdlet to crash your powershell session but here is a workaround by invoking the ZAPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#'------------------------------------------------------------------------------
Param(
   [Parameter(Mandatory=$True, HelpMessage="The cluster to connect to")]   
   [String]$Cluster,
   [Parameter(Mandatory=$True, HelpMessage="The credentials for the cluster")]   
   [System.Management.Automation.PSCredential]$Credentials
)
Import-Module DataONTAP
Connect-NcController -Name $Cluster -HTTPS -Credential $Credentials
$request = New-Object "System.Xml.XmlDocument"
$request.LoadXml("&amp;lt;cluster-log-forward-create&amp;gt;
                     &amp;lt;destination&amp;gt;wfa.testlab.local&amp;lt;/destination&amp;gt;
                     &amp;lt;facility&amp;gt;user&amp;lt;/facility&amp;gt;
                     &amp;lt;force&amp;gt;false&amp;lt;/force&amp;gt;
                     &amp;lt;port&amp;gt;514&amp;lt;/port&amp;gt;
                     &amp;lt;protocol&amp;gt;udp-unencrypted&amp;lt;/protocol&amp;gt;
                     &amp;lt;return-record&amp;gt;true&amp;lt;/return-record&amp;gt;
                     &amp;lt;verify-server&amp;gt;false&amp;lt;/verify-server&amp;gt;
                  &amp;lt;/cluster-log-forward-create&amp;gt;")
Write-Host "Invoking the 'cluster-log-forward-create' ZAPI"                 
$request.'cluster-log-forward-create'
$response = Invoke-NcSystemApi $request
$response.results."cluster-log-forward-info"
#'------------------------------------------------------------------------------&lt;/PRE&gt;&lt;P&gt;Here is an example usage:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PS C:\Scripts\PowerShell\Projects\CreateClusterLogFoward&amp;gt; .\CreateClusterLogFoward.ps1 -Cluster cluster2.testlab.local -Credentials $credentials

Name                 Address           Vserver              Version
----                 -------           -------              -------
cluster2.testlab.... 192.168.100.3                          NetApp Release 9.1: Thu Dec 22 23:05:58 UTC 2016
Invoking the 'cluster-log-forward-create' ZAPI

destination   : wfa.testlab.local
facility      : user
force         : false
port          : 514
protocol      : udp-unencrypted
return-record : true
verify-server : false&lt;/PRE&gt;&lt;P&gt;And from the CLI it now shows the cluster log foward configuration:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cluster2::&amp;gt; cluster log-forwarding show

                                                Verify  Syslog
Destination Host         Port   Protocol        Server  Facility
------------------------ ------ --------------- ------  --------
wfa.testlab.local        514    udp-unencrypted false   user&lt;/PRE&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 06:41:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/New-NcClusterLogForward-generating-a-StackOverflowException/m-p/134373#M5481</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2017-09-11T06:41:18Z</dc:date>
    </item>
  </channel>
</rss>

