06/18/2023 10:27 AM
Hi Team,
We have set up the Win PS Connector according to the doc from freshdesk, but when we try to connect to it we get a 404 error. We are using REST connector to invoke PowerShell and validated testconnection and it is successful by including testConnectionParams in connectionJSON string.
ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "",
"properties": {
"userName": "username",
"password": "password"
},
"pass": "TargetAppPssword",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"errorPath": "error",
"maxRefreshTryCount": 5,
"testConnectionParams": {
"http": {
"url": "https://XXXXXXXXX/SaviyntSite/PS/ExecutePSScript",
"httpContentType": "application/json",
"httpMethod": "POST",
"httpParams": "{\"script\":\"Test-NetConnection localhost\"}",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"successResponses": {
"response[0].PingSucceeded": [
"True"
]
}
},
"accessToken": "Basic XXXXXXXXXXXX"
}
}
}
Error from Postman:
Here is the configuration for physical path
Can anyone suggest what is the issue here ?
Thanks in advance.
The URL is "http://xx.xxx.xxx.xxx/SaviyntApp/PS/ExecutePSScript",
06/19/2023 12:24 AM
It seems like the issue is with the WINPS agent deployment itself. Please verify if Test-NetConnection is successful or not.
Please do the steps mentioned below:
1. WinPS app must be created inside the Default Web Site of the IIS server.
2. Place the WinPS agent in C:\inetpub\wwwroot folder. In your case, it is inside the C:\inetpub\wwwroot\SaviyntApp.
If you still face the same issue then, delete the existing WinPS app and refresh the Default Web Site. It will list down the agent folder. Click Right on the folder and select Change it to App option.
06/19/2023 02:59 AM
Hi @khalidakhter ,
Thanks for your reply,
Test-Netconnection is successful
Here is the folder stricture where WinPS contents are copied
I tried the option#2 by placing WinPS agent in C:\inetpub\wwwroot folder but still i see the same issue.
f you still face the same issue then, delete the existing WinPS app and refresh the Default Web Site. It will list down the agent folder. Click Right on the folder and select Change it to App option.
Can you please elaborate on 'select Change it to App option' i could not understand it.
06/19/2023 07:43 AM
Service restarted after folder path change?
Folder structure should be C:\inetpub\wwwroot\WINPS
Application hierachy should be Start > [Server]> sites > Default Web site - SaviyntApp
Also, please check SSL is configured correctly since you are hitting "https" URL.
Thanks,
Smitha
06/20/2023 06:14 AM
@smitg Thanks for you reply,
I have updated the folder structure as below
And here is the IIS site structure
test connection is working as expected and i do not think there is any issue with SSL.
We see following error :
,"call1":{"headers":{"Cache-Control":"private","Server":"Null","X-ASPNETMVC-VERSION":"Null","X-AspNet-Version":"Null","Content-Length":"3669","Date":"Tue, 20 Jun 2023 13:04:27 GMT","Content-Type":"text/html; charset=utf-8","X-Powered-By":"Null"},"statusCode":404,"description":null,"status":"Failed"}}
06/20/2023 05:51 AM
If you are getting a Success response for Test-NetConnection, It means that there is no issue with the IIS server setup.
Update the httpParams in the update account JSON as mentioned below and try provisioning use-case.
"httpParams": "{\"Script\":\"C:/IGA/PS/SaviyntTest.ps1\"}",
06/20/2023 06:19 AM
Yes, the test connection is working as expected (Test Net-Connection).
I have updated the httpParams as below and here is JSON,
06/20/2023 08:03 AM - edited 06/20/2023 08:04 AM
Please check and confirm if you are using the correct URL in your update account JSON.
https://hostname.com:port/SaviyntSite/PS/ExcecutePSScript
06/20/2023 01:03 PM
I have updated the alias to WINPS after changing the folder structure hence i am using the REST URL as :"https://***************:443/WINPS/PS/ExcecutePSScript",
Do you see any configuration issue here ?
06/26/2023 02:29 AM
All the configuration looks good. Just check if you are invoking the API call on the correct port number.
If the PORT number is correct as well then, I will recommend creating a Service Ticket to address it that may need a troubleshooting session.