I have messed with this a few different times, and never got good, consistent results.

For shares this works
 Code:
$fileservice=getobject("WinNT://" + @wksta + "/LanmanServer")
for each $share in $fileservice
  ? $share.name
  ? $share.path
  ? $share.description
  ? $share.currentusercount
next


But for Sessions and Resources, I was never able to get any reliable results.