Help with Active Directory interaction

2008-08-12 Thread John Arends
I am trying to write a script to do some work with Active Directory. Since my scripts need to run on a Linux machine, I have to use Net::LDAP. I have been going through previous postings and have found some useful information, but I am still having trouble. I took some code I wrote that talked

Re: Help with Active Directory interaction

2008-08-12 Thread Andrej Ricnik-Bay
On 13/08/2008, John Arends <[EMAIL PROTECTED]> wrote: > $mesg = $ldap->search(filter=>"(OU=SubOU,OU=myOU)", > base=>"dc=ad,dc=myorg,dc=edu"); That filter looks quite wrong - you're not qualifying any attributes, just values? Try something like filter=>"(cn=*)" -- Please don't top post, and don

Re: Help with Active Directory interaction

2008-08-12 Thread John Arends
I tried changing that line to: $mesg = $ldap->search(filter=>"(cn=*)", base=>"ou=subOU,ou=myOU,dc=ad,dc=myorg,dc=edu"); and still no output. Andrej Ricnik-Bay wrote: On 13/08/2008, John Arends <[EMAIL PROTECTED]> wrote: $mesg = $ldap->search(filter=>"(OU=SubOU,OU=myOU)", base=>"dc=ad,dc=

Re: Help with Active Directory interaction

2008-08-12 Thread Luis Cerezo
I sencond Adrej' comment about the filter. This is what works for me, I hope my code doesn't make the real programmers shudder, I am just a low-ly sysadmin. ;-) #!/usr/bin/perl # 05-30-2006| initial draft | Luis E. Cerezo use Net::LDAP; $ldap = Net::LDAP->new( 'winDC' ) or die "$@"; $mesg =

Re: Help with Active Directory interaction

2008-08-12 Thread Christopher A Bongaarts
In the immortal words of John Arends: > When I run the code I can tell I am binding because I don't get error > messages (I do get an error if I put in a bogus server). You don't know if you're binding correctly, as you're not checking the return value from the search. Try adding, between thes

Re: Help with Active Directory interaction

2008-08-12 Thread Rick Sanders
John, > Since I'm not getting any good diagnostic info, I'm having a hard time > figuring >out where to begin troubleshooting. Add the line "$ldap->debug(12);" and you'll get more info. >When I run the code I can tell I am binding because I don't get error >messages (I do get an error if I pu

Re: Help with Active Directory interaction

2008-08-12 Thread John Arends
Bingo. Adding that line showed me I was not binding correctly. I was able to fix the problem. I'm learning as I go so I appreciate the help. Christopher A Bongaarts wrote: You don't know if you're binding correctly, as you're not checking the return value from the search. Try adding, between

Re: Help with Active Directory interaction

2008-08-12 Thread Peter Karman
On 08/12/2008 01:07 PM, John Arends wrote: > I am trying to write a script to do some work with Active Directory. > Since my scripts need to run on a Linux machine, I have to use Net::LDAP. > Or try the new Net::LDAP::Class (your script rewritten below): #!/usr/bin/perl use strict; use warnin

Re: Help with Active Directory interaction

2008-08-12 Thread John Arends
Now that I'm binding ok, I'm trying to create a user but running into additional problems. I'm running into this error: failed to add entry: 0057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece at ./create.pl line 36. Thoughts? #!/usr/bin/perl us

Re: Help with Active Directory interaction

2008-08-12 Thread Peter Karman
On 08/12/2008 03:53 PM, John Arends wrote: > Now that I'm binding ok, I'm trying to create a user but running into > additional problems. > > I'm running into this error: > > failed to add entry: 0057: LdapErr: DSID-0C090B38, comment: Error in > attribute conversion operation, data 0, vece