Since the ADSecurity.dll is needed for GetSID() and it is unlikely that it would be registered on all computers, it would most likely be used with an admin script. Howard's suggestion to mine RIDs from the reg is a good one. I have also suggest a way to mine user SIDs.

When users logon, you could capture their SID with the @SID macro and write it out to an INI file along with their @UserID. Then you could mine it out without needing the DLL. Alternately, an admin script, using the DLL, could be used to populate an INI.

Not sure where you're going with all this RID/SID stuff so this may be totally irrelevant to you.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.