Thanks Guys!

I took a bit of this and a bit of that, stirred well, and here's what I ended up with. Maybe someone could Murphy-proof it and make it into a UDF.
code:
break on

$sidobj = createobject("adssid")
$sidobj.setas(5,"WinNT://@ldomain/@userid,user")
$sid = $sidobj.getas(1)

"ADSI SID = " + $sid ?

$Rev = val(substr($sid,1,2))
$SAC = val(substr($sid,3,2))

$Result = "S-" + $Rev + "-" + $SAC
For $X = 1 to $SAC
$Result = $Result + "-"+Val("&"+substr($sid,8*$X+15,2)+substr($sid,8*$X+13,2)+substr($sid,8*$X+11,2)+substr($sid,8*$X+9,2))
Next


"Translated SID = "+ $Result ?


"KiX Macro @@SID = "+@SID ?

get $_

exit 1

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.