
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 11:09 AM
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.
Solved! Go to Solution.
- Labels:
-
Orchestration (ITOM)
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 12:52 PM
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())
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 12:44 PM
I think you need to convert it to a string as it's coming back as a byte array, something like;
new Guid((System.Byte[])this.GUID).ToString()
There's a few posts about doing the conversion here: mobile - How do I convert an Active Directory objectGuid to a readable string? - Stack Overflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 12:52 PM
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())
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 01:04 PM
Also, I use this PoSh function to go the other way around:
function Get-Guid($base64) {
(new-Object -TypeName System.Guid -ArgumentList(, ( ([System.Convert]::FromBase64String($base64)) ) )).Guid
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 01:27 PM
Robert,
How would I use this in my situation? I am using the baseline Query AD workflow activity and then a run script activity with the below script.
I would think a powershell function would need to go in the Query AD powershell command.
var qry = new JSON();
qry = qry.decode(sanitizeResults(workflow.scratchpad.queryAD));
workflow.scratchpad.guid = qry['objectguid'];
gs.log(workflow.scratchpad.guid);
function sanitizeResults(qry) {
qry = qry.replace(/<\/*(powershell|output)>/g, "");
qry = qry.replace(/((^\[)|(\]$))/g, "");
return qry;
}