objectGUID returns 'System.Byte[]' when using Query AD activity

shill
Mega Sage

I am needing to update a user record that was created outside of the LDAP import with its objectGUID value as that is what our LDAP import uses to coalesce on.

I am using the Query AD orchestration activity and returning the proper user data.

But in the return json, I am getting "objectguid":"System.Byte[]" instead of something like /v5pExxhx0uGQq0UTNbs9g== .   The latter is what is provided in the LDAP import.

Is it possible to retrieve the same value as the LDAP import would receive via this activity?  

This is part of our onboarding process, so I need update the new record so that the LDAP import does not duplicate the user.

1 ACCEPTED SOLUTION

Robert Beeman
Kilo Sage

I'm doing this by passing AD's GUID property into this PoSh function:


function Get-B64($guid) {


  [System.Convert]::ToBase64String((new-Object system.Guid($guid)).ToByteArray())


}


View solution in original post

12 REPLIES 12

sergiovsj
Kilo Contributor

Thanks Steven.


Unfortunately, my issue can't be solved in the same way you did. I will continue investigating and in case I found a solution I will post it here.


This reply may be quite late; hopefully it's still helpful!



This is what I did in Geneva to find the proper ObjectSid String value [S-1-5-21-1241215720...] given a userid.


    (Note, it is not the same as the base64 value [AQUAAAAAAAUVAAAA....] your LDAP query returns)



Running a PowerShell WF activity --


Command


    (Get-AdUser ${workflow.scratchpad.userid}).SID.Value;



Sensor Script


  workflow.scratchpad.foundStringSID = output;


  workflow.scratchpad.fault = activity.fault_description;



When I tried to use QueryAD activity, I ran into the same System.Byte[] issue.


howellm
Kilo Expert

I may be way off on what I am doing but I cannot get this to work.  



var qry = new JSON();  


qry = qry.decode(sanitizeResults(data.get(9).output));


gs.log('qry: ' + JSON.stringify(qry),'mth');


gs.log('qry: object ' + qry['objectguid'],'mth');


GetB64(qry['objectguid']);


gs.log('qry: object 2 ' + qry['objectguid'],'mth');


function GetB64($guid) {  


  [System.Convert]::ToBase64String((new-Object system.Guid($guid)).ToByteArray());


}