Re: How to bind to AD?

2015-06-15 Thread Peter Karman
$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

Re: Net::LDAP::Class create entry with custom dn location

2012-10-12 Thread Peter Karman
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

Re: Wrapper module for Active Directory

2012-10-12 Thread 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

Re: [Net::LDAP] I cannot list multiple values for the same attribute

2011-08-11 Thread Peter Karman
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

Re: [Net::LDAP] Resetting AD passwords without SSL

2011-05-27 Thread Peter Karman
=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

Re: [Net::LDAP] Converting from UTF-8 to ASCII for gecos field.

2010-10-14 Thread Peter Karman
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

Re: Remove list of users from a group

2010-04-08 Thread Peter Karman
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

Re: [Net::LDAP] Remove list of users from a group

2010-04-08 Thread Peter Karman
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

Re: [Net::LDAP] Re: Dumping Net::LDAP::Entry to a string

2010-02-16 Thread Peter Karman
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

Re: [Net::LDAP] Re: How To Set AD Password

2010-01-01 Thread Peter Karman
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

Re: [Net::LDAP] RE: Creating AD account and Exchange Account

2009-12-29 Thread Peter Karman
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

Re: [Net::LDAP] Re: [Net::LDAP] LDAP and AD sync

2009-12-10 Thread Peter Karman
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

Re: [Net::LDAP] LDAP and AD sync

2009-12-10 Thread Peter Karman
. 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

Re: [Net::LDAP] Using UTF-8 in DN

2009-05-13 Thread Peter Karman
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/

Re: managing AD users through Net::LDAP

2008-10-07 Thread Peter Karman
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

Re: after upgrade: glibc detected *** /usr/bin/perl: double free or corruption

2008-10-03 Thread Peter Karman
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/

Re: Perl Script Needed To Create The Home Drectories.

2008-08-19 Thread Peter Karman
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: Help with Active Directory interaction

2008-08-13 Thread Peter Karman
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]

Re: Help with Active Directory interaction

2008-08-13 Thread Peter Karman
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 .

Re: Help with Active Directory interaction

2008-08-12 Thread Peter Karman
nally. my $user = MyUser->new( username => $uid, ldap => $ldap, password => $secret ); $user->create; -- Peter Karman . [EMAIL PROTECTED] . http://peknet.com/

Re: Help with Active Directory interaction

2008-08-12 Thread Peter Karman
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/

announce: Net::LDAP::Class

2008-08-01 Thread Peter Karman
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/