<?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: 401 unauthorized error while accessing Rest api URL-Powershell in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157091#M35607</link>
    <description>&lt;P&gt;Got it fixed. OCUM uses a different accept parameter in header variable compared to other gui's&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2020 14:17:32 GMT</pubDate>
    <dc:creator>ashish9711</dc:creator>
    <dc:date>2020-06-18T14:17:32Z</dc:date>
    <item>
      <title>401 unauthorized error while accessing Rest api URL-Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157084#M35602</link>
      <description>&lt;P&gt;Any Idea on resolving these kind of errors&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;SPAN&gt;PS C:\Users\administrator.DEMO.000&amp;gt; $UserName ="admin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;$ControllerPassword =ConvertTo-SecureString “Netapp1!” -AsPlainText -Force&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$ControllerCredential = New-Object System.Management.Automation.PsCredential($UserName,$ControllerPassword)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;$url="&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://l.facebook.com/l.php?u=https%3A%2F%2F192.168.0.71%2Frest%2Fv1%2Faggregates%3Flimit%3D20%26fbclid%3DIwAR2e3nLrEWbU5AwfkpyAECLZht2av26DfdOr5F0gO4NYYwXcU2ywQRd6YRs&amp;amp;h=AT3_vp1dy146zSK-BeNNdrwzcDmyk9zVEXVJ1OD_boJ6zNQBVDIaDBz-VevSD_teZ0bLkImQ4fxXQ_oUIkek34x6_2_tbmaB5SG3Sh2vU9U5Lz5sSbilLeK-V6MJIFTlo_XOMg" target="_blank" rel="nofollow noopener" data-lynx-mode="hover"&gt;https://192.168.0.71/rest/v1/aggregates?limit=20&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$a=Invoke-RestMethod -Uri $url -Method Get -Credential $ControllerCredential&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$a&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$a[0]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;SPAN&gt;Invoke-RestMethod : Error 401 - Unauthorized&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please go back to the homepage and try again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At line:10 char:4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+ $a=Invoke-RestMethod -Uri $url -Method Get -Credential $ControllerCredential&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+ &lt;/SPAN&gt;&lt;S&gt;&lt;SPAN&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/SPAN&gt;&lt;/S&gt;&lt;BR /&gt;&lt;SPAN&gt; + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExceptio &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; n&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cannot index into a null array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At line:12 char:1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+ $a[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+ &lt;/SPAN&gt;&lt;S&gt;&lt;SPAN&gt;~~~&lt;/SPAN&gt;&lt;/S&gt;&lt;BR /&gt;&lt;SPAN&gt; + CategoryInfo : InvalidOperation: (:) [], RuntimeException&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; + FullyQualifiedErrorId : NullArray&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS C:\Users\administrator.DEMO.000&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditorashish9711_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:04:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157084#M35602</guid>
      <dc:creator>ashish9711</dc:creator>
      <dc:date>2025-06-04T11:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: 401 unauthorized error while accessing Rest api URL-Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157085#M35603</link>
      <description>&lt;P&gt;Hi, see post from earlier this month.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/credentials-with-powershell/td-p/156757" target="_blank"&gt;https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/credentials-with-powershell/td-p/156757&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 09:51:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157085#M35603</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2020-06-18T09:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: 401 unauthorized error while accessing Rest api URL-Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157089#M35606</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/38137"&gt;@GidonMarcus&lt;/a&gt;&amp;nbsp;:&amp;nbsp;None of the solutions listed in the link contains solution to my question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 12:58:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157089#M35606</guid>
      <dc:creator>ashish9711</dc:creator>
      <dc:date>2020-06-18T12:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: 401 unauthorized error while accessing Rest api URL-Powershell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157091#M35607</link>
      <description>&lt;P&gt;Got it fixed. OCUM uses a different accept parameter in header variable compared to other gui's&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 14:17:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/401-unauthorized-error-while-accessing-Rest-api-URL-Powershell/m-p/157091#M35607</guid>
      <dc:creator>ashish9711</dc:creator>
      <dc:date>2020-06-18T14:17:32Z</dc:date>
    </item>
  </channel>
</rss>

