novice LDAP query help

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
5 answers Last reply
More about novice ldap query help
  1. 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
    >
    >
    >
  2. 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
    >>
    >>
    >>
  3. 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
  4. 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
    >>>
    >>>
    >>>
  5. Archived from groups: microsoft.public.win2000.active_directory (More info?)

    I'm funny like that. :oP

    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
    >>>>
    >>>>
    >>>>
    >
    >
    >
    >
Ask a new question

Read More

LDAP Microsoft Active Directory Windows