I'm trying to get the DN for a given username in a csv file using the Win32::ad::user module in Perl, but I can't seem to get the syntax right. Here's my code... (domain name has been replaced)
#!/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 (<CSV>) { 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/ ',$u +ser); $acdiruser->get_info(); print join ("\n", $acdiruser->get_property( dn )); } } close CSV;
Any ideas?
Thanks!!!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |