AnsweredAssumed Answered

PI WebAPI with https and Powershell

Question asked by mpalladi_cvx on Feb 16, 2017
Latest reply on Feb 17, 2017 by gregor

On a (non https) server, the following works i.e the same as what's in IE. The client machine is on the same AD domain.

     Invoke-RestMethod -Uri "http://wserver/piwebapi/attributes?path=\\AF\oaxk_analytics_temp\1FC990124%7CTrend" -UseDefaultCredentials

but when I run the same over the https it returns

     Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.

 

With some google help  I have tried ignoring certificates,

     [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

This time the error is

      Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.

Outcomes