#!/usr/bin/perl #use strict; use warnings; use Win32::AD::User; use Text::CSV; use Net::LDAP; my $file = "Users.csv"; my $csv = Text::CSV->new(); open (CSV, "<", $file) or die $!; while () { if ($csv->parse($_)) { my @username = $csv->fields(); my $user = $username[0]; my $adstring = join('', $user, ',user",',$user, '"'); my $acdiruser=Win32::AD::User->new('WinNT://my.domain.EDU/ ',$user); $acdiruser->get_info(); print join ("\n", $acdiruser->get_property( dn )); } } close CSV;