Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

HTTP 500 error when calling PS/ExecutePSScript

Sampo
Regular Contributor
Regular Contributor

Hi,

we've previously configured the Saviynt App successfully with these instructions: https://docs.saviyntcloud.com/bundle/WinPS-v24x/page/Content/Understanding_the_Integration-between-E... but this time we're having issues.

When trying to call the PS/ExecutePSScript function we receive a HTTP 500 response with error message "Object reference not set to an instance of an object".

Test call with curl:

C:\Users\<user.name>>curl --request POST --url https://<hostname>/SaviyntApp/PS/ExecutePSScript --data 'Script=c:\SaviyntApp\TestConnection.ps1' -v -k -u "<domain account>:<password>"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Host <hostname>:443 was resolved.
* IPv6: (none)
* IPv4: <ipaddress>
* Trying <ipaddress>:443...
* Connected to <hostname> (<ipaddress>) port 443
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.x
* Server auth using Basic with user '<domain account>'
> POST /WINPS/PS/ExecutePSScript HTTP/1.1
> Host: <hostname>
> Authorization: Basic <auth header>
> User-Agent: curl/8.7.1
> Accept: */*
> Content-Length: 41
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 41 bytes
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
< HTTP/1.1 500 Internal Server Error
< Cache-Control: private
< Content-Type: application/json; charset=utf-8
< Server: Microsoft-IIS/10.0
< X-AspNetMvc-Version: 5.3
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Tue, 17 Sep 2024 11:28:26 GMT
< Content-Length: 66
<
"Exception: Object reference not set to an instance of an object."* Connection #0 to host <hostname> left intact

With previous installations we've used Windows Server 2019, this time it's Windows Server 2022 but according to https://docs.saviyntcloud.com/bundle/WinPS-v24x/page/Content/Introduction.htm any releases after 2012V2 should be supported.

Do you have any ideas what can be done to troubleshoot the issue?

best regards,

Sampo

 

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Is it working from postman ?

refer https://forums.saviynt.com/t5/identity-governance/500-error-while-integrating-on-prem-exchange-with-...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Sampo
Regular Contributor
Regular Contributor

Hi Rushikesh, I tried calling with Postman and got a better error message: 

"The user \"<domain account>\" isn't assigned to any management roles.". The connection started working after adding the service account to the required Exchange management groups.

Thanks for your help!

best regards,

Sampo