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

Assistance Required with Error Handling and Log Verbosity in Saviynt v24.3

markmch
New Contributor
New Contributor

I am currently using Saviynt version 24.3 and I have encountered a couple of challenges while trying to integrate Saviynt with a Windows Server for mailbox creation via PowerShell scripts.

  1. Error Handling Issue: Despite receiving a status code of 500 from the server indicating a failure, Saviynt is marking the task as completed. This is contrary to the expected behavior where such an error should indicate an unsuccessful task completion. Here is a snippet from the log:
    markmch_0-1713991041283.png

  2. Verbose Logging Issue: When a status code of 200 is received, the logs contain an extensive amount of unnecessary information which clutters the Provisioning Comments section. I have followed the steps provided in your documentation to create outbound rules for RESPONSE_SERVER, RESPONSE_X-POWERED-BY, RESPONSE_X-ASPNET-VERSION, and RESPONSE_X-ASPNETMVC-VERSION, but the verbose logging persists. Documentation

    200 response:

    "Update Login":{"headers":"glslQ5o57A2eujs+f9dNL6nWbNXsX5xPNJDfKIakNMxKn0cKt7wHhAbiVeADlL7FN6TnRGz7YiJF7OaOMRiX8PRZ/Zo8WeoTtiBrtSlZ/TNo9Yk35hIFgXa9PCOwDWmX49xMmjsu80jDfS53VEl2PYDpz+hVwKYP1RXIKC1nrDdkNf+uAOuDmW8VOM5+AOSRkGpZaw1DmBY/0V8lOtToKVFGFW6378nXCuOm2fpsBH9Y5q08NvcQKMFaKeAebkNGNnvqDzAN39d7OXA7sNUNxSSBclIeeSnMlReWjA+cHMm034dqx9Z9v2VhHwvR63BS","message":[{"LogPipelineExecutionDetails":"False","Name":"tmp_pn0dwtzf.cps","Path":"C:\\Users\\SaviyntAppPool\\AppData\\Local\\Temp\\tmp_pn0dwtzf.cps\\tmp_pn0dwtzf.cps.psm1","Definition":"\r\n<#\r\n # Implicit remoting module\r\n # generated on 4/24/2024 7:50:27 PM\r\n # by Import-PSSession cmdlet\r\n # Invoked with the following command line: Import-PSSession $ExSession -AllowClobber\n\r\n #>\r\n \r\nparam(\r\n <# Optional parameter that can be used to specify the session on which this proxy module works #> \r\n [System.Management.Automation.Runspaces.PSSession] $PSSessionOverride,\r\n [System.Management.Automation.Remoting.PSSessionOption] $PSSessionOptionOverride\r\n)\r\n\r\n$script:__psImplicitRemoting_versionOfScriptGenerator = [Microsoft.PowerShell.Commands.ExportPSSessionCommand, Microsoft.PowerShell.Commands.Utility, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]::VersionOfScriptGenerator\r\nif ($script:__psImplicitRemoting_versionOfScriptGenerator.Major -ne 1.0)\r\n{\r\n throw 'The module cannot be loaded because it has been generated with an incompatible version of the Export-PSSession cmdlet. Generate the module with the Export-PSSession cmdlet from the current session, and try loading the module again.'\r\n}\r\n\r\n\r\n$script:WriteHost = $executionContext.InvokeCommand.GetCommand('Write-Host', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n$script:WriteWarning = $executionContext.InvokeCommand.GetCommand('Write-Warning', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n$script:WriteInformation = $executionContext.InvokeCommand.GetCommand('Write-Information', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n$script:GetPSSession = $executionContext.InvokeCommand.GetCommand('Get-PSSession', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n$script:NewPSSession = $executionContext.InvokeCommand.GetCommand('New-PSSession', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n$script:ConnectPSSession = $executionContext.InvokeCommand.GetCommand('Connect-PSSession',...0cb8df22b5d7}","PoliciesExcluded":"","EmailAddressPolicyEnabled":"True","PrimarySmtpAddress":"Xx@xxxx.com","RecipientType":"MailUser","RecipientTypeDetails":"RemoteUserMailbox","RejectMessagesFrom":"","RejectMessagesFromDLMembers":"","RejectMessagesFromSendersOrMembers":"","RequireSenderAuthenticationEnabled":"False","SimpleDisplayName":"","SendModerationNotifications":"Always","UMDtmfMap":"emailAddress:8378789683784 lastNameFirstName:8378789683784 firstNameLastName:8378789683784","WindowsEmailAddress":"Xx@xxxx.com","MailTipTranslations":"","Identity":"xx.xxrc.net/NA/CA - Xx Xx/Users/Xx","IsValid":"True","ExchangeVersion":"0.20 (15.0.0.0)","Name":"Xx","DistinguishedName":"CN=TestAccount,OU=Users,OU=XXX,OU=NA,DC=XXX,DC=xxx,DC=xx","Guid":"be10f99c-563b-427f-ab59-5d65d09adab9","ObjectCategory":"forestroot.net/Configuration/Schema/Person","ObjectClass":"top person organizationalPerson user","WhenChanged":"4/24/2024 7:50:28 PM","WhenCreated":"4/24/2024 5:47:17 AM","WhenChangedUTC":"4/24/2024 7:50:28 PM","WhenCreatedUTC":"4/24/2024 5:47:17 AM","OrganizationId":"","Id":"domain/NA/CA - ...../Users/TestAccount","OriginatingServer":"ServerName","ObjectState":"Unchanged"},{"Length":"28"}],"statusCode":200,"description":null,"status":"Success"}}

Could you please guide me on how to configure the system to handle these issues correctly? Specifically, I need Saviynt to accurately reflect unsuccessful tasks when a status code of 500 is received and to reduce the verbosity of the logs to include only the essential information.

Thank you for your assistance in resolving these issues. I look forward to your prompt response.


UpdateUserJSON
{
"actions":{
"Update Login":{
"call":[
{
"name":"call1",
"connection":"userAuth",
"url":"http://SERVER_IP/Saviynt/PS/ExecutePSScript",
"httpMethod":"POST",
"httpContentType":"application/x-www-form-urlencoded",
"httpParams":"{\"Script\":\"C:/PowerShellScripts/Exchange/CreateRemoteMailbox.ps1 -accountName \\\"TestAccount\\\" -mailNickname\\\"TestAccount\\\"\"}",
"httpHeaders":{
"Authorization":"",
"Accept":"application/x-www-form-urlencoded"
},
"successResponses":{
"statusCode":[
200
]
},
"unsuccessResponses": {
"statusCode": [500]
}
}
]
}
}
}

8 REPLIES 8

rushikeshvartak
All-Star
All-Star
{
    "actions": {
        "Update Login": {
            "call": [
                {
                    "name": "call1",
                    "connection": "userAuth",
                    "url": "http://SERVER_IP/Saviynt/PS/ExecutePSScript",
                    "httpMethod": "POST",
                    "httpContentType": "application/x-www-form-urlencoded",
                    "httpParams": "{\"Script\":\"C:/PowerShellScripts/Exchange/CreateRemoteMailbox.ps1 -accountName \\\"TestAccount\\\" -mailNickname\\\"TestAccount\\\"\"}",
                    "httpHeaders": {
                        "Authorization": "",
                        "Accept": "application/x-www-form-urlencoded"
                    },
                    "successResponses": {
                        "statusCode": [
                            200
                        ]
                    },
                    "unsuccessResponses": {
                        "responseMessage": [
                            "\"Failed\"",
                            "\"Powershell script taking too long Sample input: Invoke-Command -ComputerName \\\"<COMPUTERNAME>\\\" -ScriptBlock {command to execute} -Credential $Cred\""
                        ]
                    }
                }
            ]
        }
    }
}

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

It didn't work. Any idea?

markmch_0-1714055202679.png

 

Refer https://forums.saviynt.com/t5/identity-governance/error-while-executing-powershell-script-via-rest-c...


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

markmch
New Contributor
New Contributor

Any idea regarding to removing all the garbage information from the headers responses in successful calls to the IIS server?

You can't remove that


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

I have implemented the "Configuring Outbound Rules" section found in the documentation. but still the problem persist, should this solve the issue? or is this another thing that is currently not supported? 

try restart of IIS


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

markmch
New Contributor
New Contributor

I tried but didn't work.