your code will not work reliably
the @inwin resolves on the PC running the code, not the remote PC
the same for sidtoname.. on 'your' pc not the remote one
what you want to know is, do you have privledges on the remote PC?
There are several methods:
you can try to access the admin$ share of the target
or there is this UDF:
Code:
$BasicList = GroupMembers(@wksta + '/' + 'Administrators')
$FullList = GroupMembers(@wksta + '/' + 'Administrators',1)
for each $item in $BasicList
? $item
next
?
for each $item in $FullList
? $item
next
Function GroupMembers($target, optional $full)
DIM $group, $member, $name, $temp
$group = GetObject('WinNT://' + $target)
for each $member in $group.members
select
case $member.class = "user"
$temp = $temp +chr(13)+ $member.name
case $member.class = "group"
if $full
for each $name in $member.members
$temp = $temp +chr(13)+ $name.name
next
else
$temp = $temp +chr(13)+ $member.name
endif
endselect
next
$GroupMembers = split(substr($temp,2),chr(13))
EndFunction