#  GETUSER.PL -- Gets a list of Domain Users and Descriptions
#                and outputs the result to a .csv

#  Get the name of a DC and use it to obtain the list of users

use Win32::NetAdmin;
Win32::NetAdmin::GetDomainController("",$domain,$server);
Win32::NetAdmin::GetUsers($server,"",\@users);

#  Format output

@sort_users = sort @users;
foreach $user(@sort_users){
	unless($user =~ /\$$/){
		push @outfile,"$user\n";
	}
}


open(OUTFILE,">userlist_no_desc.csv");
print OUTFILE @outfile;
