It sounds to me like you are running this script from your desktop to collect information. You can install a newer version on your computer only to execute this code.
code:
$ou = GetObject("LDAP://DomainName/OU=texas,ou=sales,DC=mycompany,DC=net")
Dim $Filter[0]
$Filter[0] = "user"
$ou.Filter = $Filter
for each $account in $ou
$name = $account.Name
$groups = $account.groups
foreach $group in $groups
? $group.Name
next
next
{edit} Added "Name" property to " ? group.Name"
Some additional code you could leverage.
code:
;FUNCTION GetGroups()
;
;AUTHOR Howard A. Bullock (habullock@comcast.net)
;
;ACTION Retrieves groups to which the specified account is a member.
;
;SYNTAX GetGroups($Domain, $Account, optional $Suppress)
;
;PARAMETERS $Domain (Required) - String value
; $Account (Required) - String value
; $Suppress (Optional) - Integer value [0|1] Default = 0
;
;REMARKS When a non-zero value is supplied for $Suppress, The screen output
; is omitted.
;
; Note: ADS_GROUP_TYPE_SECURITY_ENABLED is not shown using WinNT://
; only security groups exists in NT4 (WinNT://)
;
;RETURNS Two-Dimensional Array.
; 0,x = Group Name
; 1,x = Group Type
; x = number of groups
;
;DEPENDENCIES KiXtart 4.11
;
;EXAMPLES $Groups = GetGroups("Domain", @wksta + "$$") for the computer account
; $Groups = GetGroups("Domain", "User1") for a user account
;
Function GetGroups($Domain, $Account, optional $Suppress)
; Group Types
; ADS_GROUP_TYPE_GLOBAL_GROUP = 0x00000002,
; ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP = 0x00000004,
; ADS_GROUP_TYPE_LOCAL_GROUP = 0x00000004,
; ADS_GROUP_TYPE_UNIVERSAL_GROUP = 0x00000008,
; ADS_GROUP_TYPE_SECURITY_ENABLED = 0x80000000
;
Dim $Groups[1,0], $i, $x, $Type[8]
$Type[2] = "GLOBAL_GROUP"
$Type[4] = "LOCAL_GROUP"
$Type[8] = "UNIVERSAL_GROUP"
$oAccount=getobject("WinNT://$Domain/$Account,user")
$x = -1
For Each $group In $oAccount.Groups
$x = $x + 1
ReDim Preserve $Groups[1,$x]
; Class is always 'Group'
; $class = $group.Class
$Groups[0,$x] = $group.Name
$Groups[1,$x] = $Type[$group.groupType]
Next
$GetGroups = $Groups
if not $Suppress
$x = ubound($Groups,2)
? $Domain + "\" + $Account + " is a member of " + ($x+1) + " groups."
For $i=0 to $x
? " '" + $Groups[0,$i] + "' (" + $Groups[1,$i] + ")"
Next
Endif
EndFunction
[ 27. September 2002, 00:03: Message edited by: Howard Bullock ]