Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

running into an error when setting windows iis server Powershell

patrickaime
New Contributor
New Contributor

patrickaime_0-1683670838328.png

 

PS C: \Windows\system32> add-type @'
>> using System. Net;
>> using System. Security.Cryptography.X509Certificates;
»› public class TrustAl1CertsPolicy : ICertificatePolicy {
>› public bool CheckValidationResult(
>> ServicePoint srvPoint, X509Certificate certificate,
>> WebRequest request, int certificateProblem)
>> return true;
>> }
>> }
>› "@
>> [System. Net . ServicePointManager]: :CertificatePolicy = New-Object TrustAl1CertsPolicy
>>
>> $Body = @{SCRIPT = "Test-NetConnection {redacted}
>>
>> Invoke-RestMethod https: // [redacted] -Method Post - Body $Body
Invoke-RestMethod :
Not Found
Not Found
HTTP Error 404. The requested resource is not found.
At line: 16 char: 1
+ Invoke-RestMethod https: //l
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+ CategoryInfo
: InvalidOperation: (System.Net.HttplebRequest:Httpl/ebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException, Microsoft.PowerShel1. Commands. InvokeRestMethodCommand

[edit: added test to post body from screenshot]

1 REPLY 1

SB
Saviynt Employee
Saviynt Employee

Can you ensure the IIS server installation is configured correctly and if you are able to access the IIS homepage. You can refer to the below guide to check for the configurations. Also the issue currently appears to be with the IIS itself which is not a Saviynt managed service. The guide though does have some examples to setup the same (Best Practices for Configuring PowerShell Scripts).

https://docs.saviyntcloud.com/bundle/WinPS-v23x/page/Content/Understanding_the_Integration-between-E...

 


Regards,
Sahil