Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/02/2024 02:47 AM - edited 08/02/2024 08:07 PM
Hi All,
We are trying to Enable and Disable the Remote Exchange mailbox, but we are unable to succeed.
Initially it throws permission error "h1:Server Error, id:header], [div:[fieldset:[h2:403 - Forbidden: Access is denied., h3:You do not have permission to view this directory or page using the credentials that you supplied.], class:content-container], id:content]]]]]"
We have received the updated script from client but now connection is getting failed "Some issues are preventing a successful connection and needs to be corrected. JSON Syntax error"
Please find the below JSON's
"CreateAccountJSON :
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "http://********.**************.com/SaviyntApp/PS/ExecutePSScript",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "POST",
"httpParams": "{\"Script\": \\"$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://*********.*******.com/powershell';
-Authentication Kerberos
Import-PSSession \\$Session -AllowClobber -DisableNameChecking | Out-Null
Import-PSSession \\$session -CommandName Enable-RemoteMailbox -AllowClobber; Enable-RemoteMailbox -Identity '${user.systemUserName}@*******.com' -RemoteRoutingAddress '${user.systemUserName}@*******.mail.onmicrosoft.com' -Alias '${user.systemUserName}' -PrimarySmtpAddress '${user.systemUserName}@*******.com';
Import-PSSession \\$session -CommandName Set-RemoteMailbox -AllowClobber; Set-RemoteMailbox -Identity '${user.systemUserName}@*******.com' -EmailAddresses @{ Add='smtp:${user.systemUserName}@*******.com','smtp:${user.systemUserName}@*******.mail.onmicrosoft.com'}; Remove-PSSession \\$session\"}",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
},
"unsuccessResponses": {
"statusCode": [
500,
404,
403,
401
]
}
}
]
}
DisableAcountJSON:
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "entAuth",
"url": "http://o365-exch.*******.com/SaviyntApp/PS/ExecutePSScript ",
"httpMethod": "POST",
"httpParams": "{\"script\": \"\\$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://o365-exch.*******.com/powershell '; -Authentication Kerberos
Import-PSSession $Session -AllowClobber -DisableNameChecking | Out-Null
Import-PSSession $session -CommandName Disable-RemoteMailbox -AllowClobber; Disable-RemoteMailbox -Identity '${user.systemUserName}@*******.com'; Remove-PSSession \\$Session\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"response[9].Objectreturned": [
"Success"
]
},
"unsuccessResponses": {
"response[9].Objectreturned": [
"Failure"
]
}
}
]
}
Connection JSON:
{
"authentications": {
"userAuth": {
"authType": "Basic",
"url": "http://o365-exch.************.com/SaviyntApp/PS/ExecutePSScript ",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "********",
"password": "*********"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic xxx",
"testConnectionParams": {
"http": {
"url": "http://o365-exch.*************.com/SaviyntApp/PS/ExecutePSScript ",
"httpMethod": "POST",
"requestBody": "",
"httpParams": {},
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${accessToken}"
},
"httpContentType": "application/json"
},
"successResponse": [],
"successResponsePath": "responseText",
"errors": [
"fail",
"error",
"false"
],
"errorPath": "responseText"
}
}
}
}
Could you please help/assist in getting it resolved.
Regards
JB
[This message has been edited by moderator to disable URL hyperlink]
08/02/2024 03:34 AM
Hi @jbaskaran , as per the error logs it seems to be permission, does your service account have all the required permissions?
08/02/2024 03:37 AM
Hi @NM,
Initially we faced permission error but now the connector itself failing saying "Some issues are preventing a successful connection and needs to be corrected. JSON Syntax error""
08/02/2024 03:38 AM
Share json?
08/02/2024 03:39 AM
Already shared
08/02/2024 10:06 AM
Fixed the syntax issue and test connection is successful but Task is not getting processed. So while checking the logs we could see that it throws error:
ot Webservice API Response: [headers:[Content-Type: text/html, Server: Null, X-Powered-By: Null, X-ASPNET-VERSION: Null, X-ASPNETMVC-VERSION: Null, Date: Fri, 02 Aug 2024 16:52:01 GMT, Content-Length: 1233], responseText:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.******">|<html xmlns="http://******">|<head>|<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>|<title>403 - Forbidden: Access is denied.</title>|<style type="text/css">|<!--|body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}|fieldset{padding:0 15px 10px 15px;} |h1{font-size:2.4em;margin:0;color:#FFF;}|h2{font-size:1.7em;margin:0;color:#CC0000;} |h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} |#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;|background-color:#555555;}|#content{margin:0 0 0 2%;position:relative;}|.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}|-->|</style>|</head>|<body>|<div id="header"><h1>Server Error</h1></div>|<div id="content">| <div class="content-container"><fieldset>| <h2>403 - Forbidden: Access is denied.</h2>| <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>| </fieldset></div>|</div>|</body>|</html>|, cookies:[], statusCode:403]
08/02/2024 10:22 AM
Hi @jbaskaran , 403.. issue related to permission
08/02/2024 04:48 PM
Is it working from postman @jbaskaran
‼️‼️⚠️Keep company-specific private information masked on public forums, such as the name and URL & passwords.⚠️‼️‼️
08/02/2024 07:41 PM
@rushikeshvartak , No it wasn't working from postman too.
We have decided to use Win Ps connector and see if that resolves the issue.
08/03/2024 01:38 AM
08/03/2024 03:31 AM
Ok noted
Regards
JB