How to programmatically search a printer in Active Directory
Attempting to find printers / shares in Active Directory using C#. This is my sample code that works for users however I cannot seen to be able to find a printer using the same concept. (I am new to Active Directory). DirectoryEntry entry = new DirectoryEntry(); entry.Path = "LDAP://xxx.xxx.xx.xx/CN=Printers;DC=domainName, DC=com"; entry.Username = @"domainName.com\Administrator"; entry.Password = "admin"; DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(objectCategory=printQueue)"; SearchResult result = search.FindOne(); if (result != null) { ResultPropertyCollection