Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Win PS Connector Server Error in Application

AtrayeeDutta
Regular Contributor
Regular Contributor

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"
}
}
}

 

 
UpdateAccountJSON:
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://********:443/SaviyntSite/PS/ExcecutePSScript",
"httpMethod": "POST",
"httpParams": "{\"Script\": \"cd C:\\\\\\\\IGA\\\\\\\\PS\\\\\\\\SaviyntTest.ps1\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses":{
"statusCode": [
200,
201,
204,
205
]
}

}]
}
 
Error Details:
Following error is showing in Saviynt logs:
AtrayeeDutta_3-1687108957190.png

Error from Postman:

Server Error in '/SaviyntSite' Application
 
AtrayeeDutta_0-1687108158458.png

 Here is the configuration for physical path 

AtrayeeDutta_2-1687108276218.png

 Can anyone suggest what is the issue here ? 

Thanks in advance.


 

 

 

The URL is "http://xx.xxx.xxx.xxx/SaviyntApp/PS/ExecutePSScript", 

9 REPLIES 9

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @AtrayeeDutta 

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.

AtrayeeDutta
Regular Contributor
Regular Contributor

Hi @khalidakhter ,

Thanks for your reply,

Test-Netconnection is successful

AtrayeeDutta_0-1687168469309.png

Here is the folder stricture where WinPS contents are copied

AtrayeeDutta_1-1687168548348.png

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.

 

 

 

smitg
Regular Contributor III
Regular Contributor III

@AtrayeeDutta 

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

AtrayeeDutta
Regular Contributor
Regular Contributor

@smitg  Thanks for you reply,

I have updated the folder structure as below 

AtrayeeDutta_0-1687266688695.png

And here is the IIS site structure 

AtrayeeDutta_1-1687266725933.png

 

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"}}

 

khalidakhter
Saviynt Employee
Saviynt Employee

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\"}",

@khalidakhter  ,

Yes, the test connection is working as expected (Test Net-Connection).

I have updated the httpParams as below and here is JSON, 

{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://***************:443/WINPS/PS/ExcecutePSScript",
"httpMethod": "POST",
        "httpParams": "{\"Script\":\"C:/IGA/PS/SaviyntTest.ps1\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses":{
          "statusCode": [
          200,
          201,
          204,
          205
        ]
         }
 
}]
}
 
I am still seeing the 404 error , here are logs:
AtrayeeDutta_2-1687267143996.png

 

 

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @AtrayeeDutta 

Please check and confirm if you are using the correct URL in your update account JSON.
https://hostname.com:port/SaviyntSite/PS/ExcecutePSScript

@khalidakhter ,

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",

AtrayeeDutta_0-1687291216999.png

 

 

AtrayeeDutta_1-1687291246048.png

 

Do you see any configuration issue here ?

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @AtrayeeDutta 

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.