Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Net::LDAP and AD

by g0n (Priest)
on Jun 27, 2006 at 16:41 UTC ( #557837=note: print w/ replies, xml ) Need Help??


in reply to Re: Net::LDAP and AD
in thread Net::LDAP and AD

Um, that should be straight forward. Get a list of the users, query their PrimaryGroupID, store that somewhere (in a hash? :-), see what's in memberOf, get the groupIds of the returned groups and determine the users primary group by comparing their PrimaryGroupId with the groupIds found.
That approach definitely works - I solved the same problem in javascript that way (although I don't have the code anymore).

There could be a maxRows limitation of an LDAP query to AD.
AD defaults to a page size of 1000 objects. You need to use the Net::LDAP::Control::Paged control to handle anything bigger than that. I have code returning tens of thousands of entries from AD on port 389 without a problem that way.

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".

Can you spare 2 minutes to help with my research? If so, please click here


Comment on Re^2: Net::LDAP and AD

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://557837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-12-25 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls