## Re: DirXML-Association scenario

Alex McHugh wrote:

> David Gersic <dgersic@no-mx.forums.netiq.com> wrote:
> > the
> > SysInternals tool, but byte-flipped.
> >

>
> It's not purely byte flipped.

Just a followup. If you are using PowerShell, then here is a simple one-liner to get from the regular GUID to the assocation value.

[System.BitConverter]::ToString([System.GUID]::Parse('{6B29FC40-CA47-1067-B31D-00DD010662DA}').ToByteArray()).toLower() -replace '-'

Just replace the value within the curly brackets with your own GUID.

That approach above parses the textual GUID to an internal binary representation, then calls some .NET functions which output the string/hex representation of the raw binary.

However if you want to do this manually (or in another programming language), the following is the plain-english formula for converting from AD GUID to Association.
Note that it is not purely byte-flipped representation.

1. Remove curly braces and hyphens.
2. Reverse first 8 characters i.e. '6B29FC40' becomes '40fc296b'
3. Reverse next 4 characters i.e. 'CA47' becomes '47ca'
4. Reverse next 4 characters i.e. '1067' becomes '6710'
5. Copy, unchanged the next 4 characters i.e. 'B31D' stays as 'B31D'
6. Copy, unchanged the next 12 characters i.e. '00DD010662DA' stays as '00dd010662da'

This example should return:

40fc296b47ca6710b31d00dd010662da