richardun / active_directory

Native Ruby Access to Microsoft Active Directory
http://rubyforge.org/projects/activedirectory
12 stars 8 forks source link

Cannot use a filter and an attributes at the same time #13

Open acaeti opened 10 years ago

acaeti commented 10 years ago

Hello,

Seems I can run a query using either a filter, or attributes, but not both.

If I try to specify both:

user = ActiveDirectory::Users.find(:all, filter, :select => ['sn','givenname'])

I get back results as if I submitted only the filter.

Attributes work fine if I submit with a simple-type find, however:

user = ActiveDirectory::Users.find(:all, :displayname => "Bob*", :select => ['sn','givenname'])

NPM

acaeti commented 10 years ago

I have found that I can use find_all like so:

users = ActiveDirectory::Users.find_all(:filter => filter, :select => ['sn','givenname'])

Perhaps I am making a syntax mistake with my .find(:all)?