$msg->code,
"Message: " . $msg->error_name,
" :" . $msg->error_text,
"MessageID: " . $msg->mesg_id,
"DN: " . $msg->dn,
) . "\n";
return 0;
}
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
based on a specific user detail.
Assuming you are using NLC::User::AD, then no.
However, it looks to me like you could override setup_for_write() in
your User subclass and specify whatever $cn you wanted, which would then
be prepended to the $base_dn in action_for_create().
--
Peter Karman
:LDAP prefix in the name?
Isn't there already a Net::LDAP::Extra::AD on CPAN?
Have you looked at Net::LDAP::Class? There's AD-specific User and Group
classes there too.
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
ntries) {
for my $attr ($entry->attributes) {
if ($attr eq 'description') {
printf("%s -> %s\n", $attr,
join(", ", $entry->get_value($attr))
);
}
}
}
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
=50924
>
> Sam
>
This is how I set the password in AD:
http://search.cpan.org/~karman/Net-LDAP-Class-0.26/lib/Net/LDAP/Class/User/AD.pm#password([plain_password])
read the source for the password() method.
IIRC, SSL or TLS was not required, but binding in the initial LDAP
connection with a u
ot;?
>
use Search::Tools::Transliterate;
my $ascifier = Search::Tools::Transliterate->new( ebit => 0 );
my $gecos = $ascifier->convert($gecos);
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
on and method calls.
The typical Perl idiom looks like:
my $value = $thing->dosomething(@args)
or die "dosomthing failed: " . $thing->error;
That assumes that dosomething returns false on error and has an error()
method but you get the idea.
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
lar? I will happily post my current code if
> requested. Thanks again!
If you want specific feedback, posting your code is a good step.
You might want to look at Net::LDAP::Class for other ways to achieve
your task. Even if you don't use the module, you can see example code
for searching and
will not mind using an old version of Net::LDAP
>>> IMO.
>
> I disagree with this statement. ;) RHEL4, for example, ships with perl
> 5.8.5, and remains one of the most widely deployed Linux distributions
> in the corporate environment.
I didn't hear the OP referring to 5.8
he list
archives, in Net::LDAP::Class::User::AD on CPAN. Look at the source for the
password() method and the private methods for encoding/decoding the string.
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
for details on userAccountControl.
# basically:
# 512 - normal active account requiring password
# 514 - normal disabled account requiring password
# 544 - system active account - no password required
# 546 - system disabled account - no password required (default)
--
Peter Karman . http://pek
Peter Karman wrote on 12/10/09 5:48 PM:
Prashanth Sundaram wrote on 12/10/09 4:59 PM:
Folks,
I am a n00b to perl scripting and need help to start building my own.
I am
currently working on a project where the LDAP(389-ds) and Active
Directory
are always in sync. I have a very minimal set
.
Net::LDAP::Class should make most if not all of those requirements pretty easy
to implement. It was written to ease keeping a rdbms, LDAP and AD all in sync.
--
Peter Karman . http://peknet.com/ . pe...@peknet.com
UTF8;
my $ascifier = Search::Tools::Transliterate->new( ebit => 0 );
my $ascii= $ascifier->convert( to_utf8( $my_email ) );
--
Peter Karman . pe...@peknet.com . http://peknet.com/
we have 100s of OrgUnits). I actually have a
Net::LDAP::Class-derived class for OrgUnit and each User class uses a
OrgUnit class as its primary group.
I think the $work approach succeeds because of our particular security
requirements. I hope that Net::LDAP::Class::*::AD can also work for
folks imple
ap.
I've seen that error message when the version of glibc changes. Have you
tried re-installing Net::LDAP so that is is compiled against the same
libs that your perl is?
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
y_list_of_rollnos) {
my $path = dir( $base, $rollno );
$path->mkpath(1);
chown $path, $rollno or die "can't chown $path $rollno: $!";
# ^^ probably needs to run as root to work
}
and next time, ask on the right list for this kind of thing. This is not an
LDAP question.
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
re you get the accurate epoch value for
a date in the future.
E.g.:
my $win_time = ( $datetime_in_future->epoch * 1000 ) + 11644524000;
--
Peter Karman . http://peknet.com/ . [EMAIL PROTECTED]
On 08/13/2008 10:20 AM, Barrett, John wrote:
> You might want to check your variable names for consistency - $first vs.
> $firstname
>
>
> #!/usr/bin/perl
>
use strict; # get in the habit.
> use Net::LDAP;
> use Unicode::Map8;
>
--
Peter Karman .
nally.
my $user = MyUser->new( username => $uid, ldap => $ldap, password => $secret );
$user->create;
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
gt; "&(sAMAccountName=*)" );
foreach my $user (@users) {
foreach my $attr (@{ $user->attributes }) {
printf( "%s : %s\n", $attr, $user->$attr || '' );
}
}
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
my $job where I need to manage both Active Directory and
OpenLDAP servers,
and synchronize both with a standard RDBMS.
Comments, criticisms (nicely worded), bug reports, all welcome.
cheers,
pek
--
Peter Karman . [EMAIL PROTECTED] . http://peknet.com/
22 matches
Mail list logo