Sign in with
Sign up | Sign in
Your question

novice LDAP query help

Last response: in Windows 2000/NT
Share
Anonymous
December 13, 2004 11:02:32 PM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

Wondering if anyone can help me write a pretty basic LDAP query for an LDAP
novice.

Wanted to return all computers whose cn begins with either NARM or EUUK

This is what I have so far and it isn't working
(|(cn=euuk*) (cn=narm*))

Thanks,
JM

--

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Q: What is the difference between Vietnam and Iraq?
A: Bush had an exit strategy for Vietnam

More about : novice ldap query

Anonymous
December 14, 2004 5:09:04 AM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

(&(objectCategory=computer)((cn=euuk*) (cn=narm*)))


"Joe Murphy" wrote:

> Wondering if anyone can help me write a pretty basic LDAP query for an LDAP
> novice.
>
> Wanted to return all computers whose cn begins with either NARM or EUUK
>
> This is what I have so far and it isn't working
> (|(cn=euuk*) (cn=narm*))
>
> Thanks,
> JM
>
> --
>
> *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
> Q: What is the difference between Vietnam and Iraq?
> A: Bush had an exit strategy for Vietnam
>
>
>
Anonymous
December 14, 2004 12:20:23 PM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

Close...

(&(objectCategory=computer)(|(cn=euuk*)(cn=narm*)))

forgot the OR (|) for the names.


joe

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net


Desmond Lee wrote:
> (&(objectCategory=computer)((cn=euuk*) (cn=narm*)))
>
>
> "Joe Murphy" wrote:
>
>
>>Wondering if anyone can help me write a pretty basic LDAP query for an LDAP
>>novice.
>>
>>Wanted to return all computers whose cn begins with either NARM or EUUK
>>
>>This is what I have so far and it isn't working
>>(|(cn=euuk*) (cn=narm*))
>>
>>Thanks,
>>JM
>>
>>--
>>
>>*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
>>Q: What is the difference between Vietnam and Iraq?
>>A: Bush had an exit strategy for Vietnam
>>
>>
>>
Related resources
December 15, 2004 12:13:18 AM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

On Mon, 13 Dec 2004 20:02:32 -0500, "Joe Murphy"
<jmurpNOSPAM@NOSPAMrcn.com> wrote:

>Wondering if anyone can help me write a pretty basic LDAP query for an LDAP
>novice.
>
>Wanted to return all computers whose cn begins with either NARM or EUUK
>
>This is what I have so far and it isn't working
>( | (cn=euuk*) (cn=narm*) )
>
In what way is it not working? Is it not returning any results, or is
it giving too many results?

Have you tried each part separately?

Cheers,

Cliff
--

The National Party manifesto can be viewed here:

http://www.labour.org.nz/policy/index.html
Anonymous
December 15, 2004 2:15:04 AM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

Hi Joe,

Funny it should be you to reply to my query help. I'm using oldcmp.exe to
try and disable/delete computers, but I don't want to disable/delete any
whose name starts with euuk or narm

I ran:
oldcmp -age 0 -af (&(objectCategory=computer)(|(cn=euuk*)(cn=narm*))) -h
nahqdcs2.mycorp.com -report

and I get the error:
( was unexpected at this time.


"Joe Richards [MVP]" <humorexpress@hotmail.com> wrote in message
news:udBuNge4EHA.1400@TK2MSFTNGP11.phx.gbl...
> Close...
>
> (&(objectCategory=computer)(|(cn=euuk*)(cn=narm*)))
>
> forgot the OR (|) for the names.
>
>
> joe
>
> --
> Joe Richards Microsoft MVP Windows Server Directory Services
> www.joeware.net
>
>
> Desmond Lee wrote:
>> (&(objectCategory=computer)((cn=euuk*) (cn=narm*)))
>>
>>
>> "Joe Murphy" wrote:
>>
>>
>>>Wondering if anyone can help me write a pretty basic LDAP query for an
>>>LDAP novice.
>>>
>>>Wanted to return all computers whose cn begins with either NARM or EUUK
>>>
>>>This is what I have so far and it isn't working
>>>(|(cn=euuk*) (cn=narm*))
>>>
>>>Thanks,
>>>JM
>>>
>>>--
>>>
>>>*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
>>>Q: What is the difference between Vietnam and Iraq?
>>>A: Bush had an exit strategy for Vietnam
>>>
>>>
>>>
Anonymous
December 17, 2004 2:54:47 AM

Archived from groups: microsoft.public.win2000.active_directory (More info?)

I'm funny like that. :o P

You are using -af which is to ADD to the default filter and what you probably
wanted was -f to replace the filter though that would work as a -af filter, it
would just be a bit redundant. The main reason that specifically didn't work is
that you didn't quote the af string and the & told the command interpreter you
had two commands on one line.

For instance you can do

net stop alerter & net start alerter

The & splits the commands and says do the first and then do the second.



Anyway to this with -af you would want to specify something like

-af "(&(!(cn=euuk*))(!(cn=narm*)))"

You actually want to exclude those names so you need to look for the NOT of them.

joe


--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net


Joe Murphy wrote:
> Hi Joe,
>
> Funny it should be you to reply to my query help. I'm using oldcmp.exe to
> try and disable/delete computers, but I don't want to disable/delete any
> whose name starts with euuk or narm
>
> I ran:
> oldcmp -age 0 -af (&(objectCategory=computer)(|(cn=euuk*)(cn=narm*))) -h
> nahqdcs2.mycorp.com -report
>
> and I get the error:
> ( was unexpected at this time.
>
>
> "Joe Richards [MVP]" <humorexpress@hotmail.com> wrote in message
> news:udBuNge4EHA.1400@TK2MSFTNGP11.phx.gbl...
>
>>Close...
>>
>>(&(objectCategory=computer)(|(cn=euuk*)(cn=narm*)))
>>
>>forgot the OR (|) for the names.
>>
>>
>> joe
>>
>>--
>>Joe Richards Microsoft MVP Windows Server Directory Services
>>www.joeware.net
>>
>>
>>Desmond Lee wrote:
>>
>>>(&(objectCategory=computer)((cn=euuk*) (cn=narm*)))
>>>
>>>
>>>"Joe Murphy" wrote:
>>>
>>>
>>>
>>>>Wondering if anyone can help me write a pretty basic LDAP query for an
>>>>LDAP novice.
>>>>
>>>>Wanted to return all computers whose cn begins with either NARM or EUUK
>>>>
>>>>This is what I have so far and it isn't working
>>>>(|(cn=euuk*) (cn=narm*))
>>>>
>>>>Thanks,
>>>>JM
>>>>
>>>>--
>>>>
>>>>*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
>>>>Q: What is the difference between Vietnam and Iraq?
>>>>A: Bush had an exit strategy for Vietnam
>>>>
>>>>
>>>>
>
>
>
>
!