Trying to obtain memberof detail from linux ldapsearch command


I am trying run an LDAP query from a Linux machine (CentOS 5.8) to a Windows LDAP server and want to get 'memberof' detail for a user. In this example, the  Domain is cm.loc and the user is admin1@cm.loc. Here is the ldapsearch syntax I am using. It returns an error.
Can someone point me in the right direction with what the correct syntax should be using ldapsearch to query for memberof detail for a particular account?

Here is what I am using that returns error;  "ldap search ext bad search filter 7"

ldapsearch –x –h –b 'DC=cm,DC=loc' -s base –D 'admin1@cm.loc' -W '(&(objectCategory=Group)(|(memberOf=group1)(memberOf=group2)…))'

Thank You
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
Hi, please provide your complete query, the error message has "7" which doesn't show in the query you've posted.
Charlie_MelegaAuthor Commented:
Thanks for the quick reply. Here is a screenshot of the full ldapsearch query I attempt to run with the error referenced:

 ldap query fail
Gerwin Jansen, EE MVETopic Advisor Commented:
The 3 dots at the end of your filter are not correct, you should remove them. You've probably found them in an example, right?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Charlie_MelegaAuthor Commented:
yes, i went ahead and removed them and also tried to modify the member of detail so the syntax was correct but still no luck;

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.