Query Printers In active Directory using LDAP RRS feed

  • Question

  • User1559438460 posted

    OK so I know a little about Ldap in that i can successfully connect to AD through LDAP and return a list of security groups from a folder and that all works great BUT

    I am querying through ASP.NET and im trying to get a list of printers which I believe can be found by the query using (objectCategpry=printQueue)

    So are these printer objects stored somewhere, I mean in a folder like the security groups are, I don't know much about AD but I'm told that the printers are published through AD, Anyone know what this means?

    I'm confused as nobody seems to be able to tell me where in AD the printer object are, they just tell me they are there, do i search on the root folder????

    This may sound confusing sorry, its becuase im confused myself as I can't even view the AD structure, its a nightmare


    Thanks for any help and also thanks for all the help given in the past


    Friday, June 30, 2006 11:37 AM

All replies

  • User1559438460 posted

    To simply my questions into two straightforward part

    1) How can I replicate the following Query using LDAP?:

    When Using AD GUI I search the entire directory for printers in the search menu


    2) How can i search the entire directory?

    Monday, July 3, 2006 6:54 AM
  • User1080000547 posted

    Hi Cully,

    Print queues are stored in AD, the specific location they are stored is as a child of the print server that they are attached to. For example:


    To search for the print queues you seem to be on track in that you need to search for object with the objectcategory=printqueue. I would recommend you look at Dunnry's excellent common paterns post (http://forums.asp.net/thread/1007517.aspx) for how to search the domain and just replace the LDAP path in the searchRoot constructor to be the root of your AD (e.g. LDAP://server/DC=domain,DC=org) and replace the query with "(objectcategory=printqueue)".



    Monday, July 3, 2006 1:49 PM
  • User1559438460 posted
    Thank you very much sir I found them under the print server, thankyou
    Tuesday, July 4, 2006 6:58 AM