and more in a single search tool across platforms. Read the announcement here. |
07/07/2023 05:25 AM
Below Json is not working to AD based connector.
{
"objects": [{
"objectClasses": ["user", "person", "organizationalPerson", "top"],
"distinguishedName": "${account.accountID?.replace('\\', '\\\\')?.replace('/', '\\/')}",
"attributes":
{
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}",
}
}]
}
license and access are dynamic attributes.
When a request is raised for access, it is working as expected but after the task completed value is not getting added in AD.
Let me know if there is any syntactical error in code.
Thanks
Bhanu kumar
07/07/2023 05:45 AM
What is the error in the logs?
07/07/2023 07:02 AM
Hello,
Error in logs is as below:
status:Success, message:Failed to update attributes., messageCodes:OBJ_ERR_00022, errorDetails:OBJ_ERR_00022 : -2147467261 : Object reference not set to an instance of an object.]], connectionString:LDAP://na.xerox.org
Thanks
07/07/2023 08:03 AM
Do you need to update objectclass and distinguishedName in case update account?
Also please try to use below JSON and see if it makes any difference?
{
"objectClasses": ["user", "person", "organizationalPerson", "top"],
"distinguishedName": "${account.accountID?.replace('\\', '\\\\')?.replace('/', '\\/')}",
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"
}
If object class and DN are not required to change on update please remove them and try as below
{
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"
}
07/07/2023 09:36 AM
it is not working.
The Task gets completed successfully but the extensionattribute values is not updated . Looks like a logical / syntax error
07/08/2023 09:28 AM
What if hardcoded value
07/10/2023 05:02 AM
Hi Rushikesh,
If the values are hardcoded, they are getting added in AD.
if conditions are used they are not.
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"
Thanks