use strict; use Win32::OLE 'in'; my $dc=; my $group=; # GET ALL MEMBERS OF GROUP my $ADsPath="$dc/cn=$group,cn=Users,dc=restricted,dc=hmce,dc=local"; my $adsobjs=Win32::OLE->GetObject("LDAP://".$ADsPath) or die "Unable to get $ADsPath\n"; my (@users,$user); foreach $user(in $adsobjs->{member}) { push(@users,lc($user)); } foreach $user(sort @users) { print "$user\n"; }