I need a list with all the printers in AD, I can list users, groups and pc's but I don't know how to do it with printers. Is it possible to achieve it without using DirectorySearcher.
I used this code to list my users, groups, and pc's. Can I use something similar to list printers.
try {
domain = new PrincipalContext(ContextType.Domain, @"mydomain", @"user", @"pass");
}//try
catch (Exception ex) {
return false;
}//catch
PrincipalSearcher searcher = new PrincipalSearcher();
UserPrincipal finduser = new UserPrincipal(domain);
searcher.QueryFilter = finduser;
PrincipalSearchResult<Principal> Users = searcher.FindAll();
Response.Write("USUARIOS</br>");
foreach (var usr in Users)
{
Response.Write(usr.DisplayName+" ");
}//foreach