jklemm2000
Apr 03, 2019Nimbostratus
APM variable Assign Convert from HEX to original Format
I am doing an LDAP query which polls ldap for user attributes and I want to take the objectSid attribute and insert it in a header upon policy completion. The issue I am running into is the application only accepts the SID in a format like this "S-1-5-21-3151507965-1511538023-2697414875-1234567" and not the HEX encoded format that APM returns. I have attempted to get this to work a few different ways with my latest attached. Can someone help shed some light on this?
set var [mcget {session.ldap.last.attr.objectSid}] if { [string range $var 0 1 ] == "0x" } { return "[encoding convertfrom utf-8 [binary format H* [string range $var 2 [string length $var]]]]" } return "[mcget {session.ldap.last.attr.objectSid}]"