this is the function to get the sid of a remote user (assuming the user is logged in)
code:
 Function RemoteSid($computer, $remoteusername)
dim $sid, $logonname, $index, $HKUsidSMWCVE
$index=0
:sidloop
$sid=enumkey("\\$computer\hkey_users\",$index)
if not @error and not instr($sid,"_")
$HKUsidSMWCVE = "HKEY_USERS\$sid\Software\Microsoft\Windows\CurrentVersion\Explorer"
$LogonName=readvalue("\\$computer\$HKUsidSMWCVE","Logon User Name")
if $remoteusername=$LogonName
$RemoteSid=$sid
exit 0
return
else
$index=$index+1
$sid=''
exit 1
goto sidloop
endif
endif
endfunction

_________________________
How to ask questions the smart way <-----------> Before you ask