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

ADSI updateAccount Json issue

BhanuKumar
New Contributor
New Contributor

Hi,

I am using below UpdateAccount JSON in ADSI Connector.

{
"objects": [{
"objectClasses": ["user", "person", "organizationalPerson", "top"],
"distinguishedName": "${account.accountID?.replace('\\', '\\\\')?.replace('/', '\\/')}",
"attributes":
{
"msDS-cloudExtensionAttribute2": "${if((license == 'Office-Pro-Plus' && access == 'YES') || (account.customproperty35 == 'OPP')){('OPP')}}",
"msDS-cloudExtensionAttribute6": "${if((license == 'Power-BI-Pro' && access == 'YES') || (account.customproperty36 == 'PBI')){('PBI')}}",
"msDS-cloudExtensionAttribute7": "${if((license == 'MS-Teams-Conference' && access == 'YES') || (account.customproperty37 == 'AC')){('AC')}}",
"msDS-cloudExtensionAttribute8": "${if(((license == 'MS-Teams-Phone-Standard' && access == 'YES')&&(user?.customproperty8 == 'CP2' || user?.customproperty8 == 'EP1')) || (account.customproperty38 == 'TPSDCP')) {('TPSDCP')} else if(((license == 'MS-Teams-Phone-Standard' && access == 'YES')&&(user?.customproperty8 =='KW1')) || (account.customproperty38 == 'TPS')){('TPS')}}"
}
}]
}

Tasks is getting completed but value is not getting added in AD.

Logs:

2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG rest.RestUtilService - Got showLogs = true
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG adsi.SaviyntGroovyADSIService - httpParams: {"objects":[{"objectClasses":["user","person","organizationalPerson","top"],"distinguishedName":"CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org","attributes":{"msDS-cloudExtensionAttribute2":null,"msDS-cloudExtensionAttribute6":"PBI","msDS-cloudExtensionAttribute7":null,"msDS-cloudExtensionAttribute8":null}}],"connectionString":["LDAP://na.xerox.org"]}
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG adsi.SaviyntGroovyADSIService - httpContentType : application/json
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - isFipsEnabled = false
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslParams : null
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - proxyParams : null
2023-07-21 11:04:26,565 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslSocketFactory : null
2023-07-21 11:04:26,567 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - setting connection timeout to 0 seconds and request timeout to 0 seconds
2023-07-21 11:04:26,568 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - HttpClientBuilder.create().build() called.
2023-07-21 11:04:28,709 [quartzScheduler_Worker-3] DEBUG adsi.SaviyntGroovyADSIService - Got responseStstusCode: 200
2023-07-21 11:04:28,709 [quartzScheduler_Worker-3] DEBUG adsi.SaviyntGroovyADSIService - updateAccountResponse : [status:Success, objects:[[id:CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org, attributes:[samaccountname:w63LLL7K, givenname:kirtitest, codepage:0, xerox-person-status:B, objectcategory:CN=Person,CN=Schema,CN=Configuration,DC=xerox,DC=org, msds-externaldirectoryobjectid:User_40407390-c985-4f2b-9c05-814ac5c67ade, description:External, usnchanged:219166928, instancetype:4, name:w63LLL7K, pwdlastset:132610516608740532, xerox-person-disabled:0, employeetype:XEROX_EMPLOYEE, objectclass:[top, person, organizationalPerson, user], samaccounttype:805306368, employeenumber:w63LLL7K, employeeid:x6R6LZGP, usncreated:176638564, sn:gupta, xerox-user-type:INT-EMP-OT, o:Xerox Corporation, company:Xerox Corporation, objectguid:8308dadb-f2cd-44ff-85ab-5e09215e29e6, whencreated:2021/03/24 09:27:40, manager:CN=Testuser21\, Phase2hcl44,OU=SVCPVD,OU=NONEMPLOYEE,DC=na,DC=xerox,DC=org, adspath:LDAP://na.xerox.org/CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org, useraccountcontrol:512, cn:w63LLL7K, countrycode:356, co:INDIA, l:Not at a Xerox location, primarygroupid:513, whenchanged:7/21/2023 11:04:28 AM, c:IN, xerox-m365-pdl:NAM, legacyemployeenumber:w63LLL7K, dscorepropagationdata:[2023/03/27 18:04:43, 2022/06/23 13:45:05, 2022/03/01 17:49:44, 2021/05/18 10:27:10, 1601/07/14 22:36:49], distinguishedname:CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org, st:UNKNOWN, ms-ds-consistencyguid:29oIg83y/0SFq14JIV4p5g==, xerox-person-sor:ManAddTool, xerox-countrycode:IND, postalcode:UNKNOWN, objectsid:S-1-5-21-484763869-299502267-682003330-363238, displayname:w63LLL7K, xerox-person-email:kirtitest.gupta@xerox.org, xerox-s3-guid:S3-e6cee-178639fce61-955a8d8d2a2f27fa443eaa6d4be76e6c, accountexpires:9223372036854775807, userprincipalname:w63LLL7K@xerox.org, member:[CN=Domain Users,CN=Users,DC=na,DC=xerox,DC=org], reconciliationID:8308dadb-f2cd-44ff-85ab-5e09215e29e6###S-1-5-21-484763869-299502267-682003330-363238], 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]
2023-07-21 11:04:28,711 [quartzScheduler_Worker-3] DEBUG adsi.SaviyntGroovyADSIService - updateAccObj-{"customproperty4":"'x6R6LZGP'","accountid":"'CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org'","customproperty2":"'512'","customproperty3":"'w63LLL7K@xerox.org'","comments":"'CN=w63LLL7K,OU=Users-Resource,OU=USA,DC=na,DC=xerox,DC=org'","customproperty1":"'w63LLL7K'","displayname":"'w63LLL7K'","name":"'w63LLL7K'","customproperty28":"'8308dadb-f2cd-44ff-85ab-5e09215e29e6'","accountclass":"'top,person,organizationalPerson,user'"}

Is it possible to use groovy JSON in ADSI connector.

If it can be used, please provide a sample updateaccount JSON for ADSI connector.

Please check and help out.

Thanks

Bhanu Kumar

[This post has been edited by a Moderator to merge several posts into one.]

2 REPLIES 2

SB
Saviynt Employee
Saviynt Employee

Based on my research, the error indicates that one of the extension attributes might have been deleted from the Object. Can you check for any user for whom these values are populated and also share a snippet for the same.


Regards,
Sahil

rushikeshvartak
All-Star
All-Star

The message "object reference not set to an instance of an object" means that you are referring to an object the does not exist or was deleted or cleaned up. It's usually better to avoid a NullReferenceException than to handle it after it occurs.

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.