Matchete has asked for the wisdom of the Perl Monks concerning the following question:
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!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::AD::User - can't seem to figure out how to retrieve a DN
by wwe (Friar) on May 18, 2012 at 08:09 UTC |