05/09/2023 03:21 PM - last edited on 05/10/2023 02:44 PM by Tim
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]
05/11/2023 03:42 PM
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).