<?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: When executing an ONTAP command thru PowerShell using plink or Invoke-NcSSH I am getting an erro in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170124#M39112</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running the command syntax, use the {} for the command after cmddirname like in the example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$commands =&amp;nbsp; 'security login role modify -role netapp-harvest-role -access readonly -cmddirname {cluster identity show} '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this answer your question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 02:49:14 GMT</pubDate>
    <dc:creator>hmoubara</dc:creator>
    <dc:date>2021-09-21T02:49:14Z</dc:date>
    <item>
      <title>When executing an ONTAP command thru PowerShell using plink or Invoke-NcSSH I am getting an error</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170110#M39104</link>
      <description>&lt;P&gt;I am baffled by this particular issue and need some help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a PowerShell script to add a role to several NetApp controllers. The command is as follows:&lt;/P&gt;&lt;P&gt;$commands =&amp;nbsp; 'security login role modify -role netapp-harvest-role -access readonly -cmddirname cluster identity show '&lt;/P&gt;&lt;P&gt;The error says: "&amp;nbsp;&amp;nbsp;Error: "identity" was not expected. Please specify -fieldname first.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I ran the command on the cluster CLI and it works without a problem. Its not accepting the second argument in the -cmddirname&amp;nbsp; attribute. However, it does work with a single argument in this command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried directly with "plink.exe" and&amp;nbsp; "Invoke-NcSSH"&amp;nbsp; but neither of them worked.&lt;/P&gt;&lt;P&gt;Here is the command syntax for both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-NcSSH&lt;/P&gt;&lt;P&gt;Invoke-NcSsh -Command $commands -Controller $controllerip -Credential $credentials&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLINK&lt;/P&gt;&lt;P&gt;plink.exe -ssh $controllerip -l $username -pw $secondpass -batch $commands&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure whats wrong, but could use some help with this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any ideas????&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:13:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170110#M39104</guid>
      <dc:creator>tadinifni</dc:creator>
      <dc:date>2025-06-04T10:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: When executing an ONTAP command thru PowerShell using plink or Invoke-NcSSH I am getting an erro</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170124#M39112</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running the command syntax, use the {} for the command after cmddirname like in the example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$commands =&amp;nbsp; 'security login role modify -role netapp-harvest-role -access readonly -cmddirname {cluster identity show} '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this answer your question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 02:49:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170124#M39112</guid>
      <dc:creator>hmoubara</dc:creator>
      <dc:date>2021-09-21T02:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: When executing an ONTAP command thru PowerShell using plink or Invoke-NcSSH I am getting an erro</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170175#M39122</link>
      <description>&lt;P&gt;That solved my issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 13:57:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-executing-an-ONTAP-command-thru-PowerShell-using-plink-or-Invoke-NcSSH-I-am/m-p/170175#M39122</guid>
      <dc:creator>tadinifni</dc:creator>
      <dc:date>2021-09-22T13:57:22Z</dc:date>
    </item>
  </channel>
</rss>

