Advertisement

05.22.2008 at 12:38PM PDT, ID: 23425673
[x]
Attachment Details

Active Directory Print Queue Administration:  Load Additional properties and retreive values

Asked by Trypsim in Microsoft Visual C#.Net, Visual Studio 2008, .NET Framework 3.x versions

Tags: Microsoft, C#, Visual Studio 2008, .NET 3.5

I need to obtain information from 3 additional fields.

location  
description
driverversion

Once you load the property how does one retreive the information.


Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
public static void ListAllPrinters(string OUDN)
        {
            DirectoryEntry entry = new DirectoryEntry("LDAP://" + OUDN);
            DirectorySearcher DirSearch = new DirectorySearcher(entry);
            DirSearch.PropertiesToLoad.Add("location");
            DirSearch.PropertiesToLoad.Add("description");
            DirSearch.PropertiesToLoad.Add("driverversion");
 
            DirSearch.Filter = "(ObjectCategory=" + "printQueue" + ")";
            DirSearch.PageSize = 3000;
 
 
            foreach (SearchResult result in DirSearch.FindAll())
            {
                string Name = result.GetDirectoryEntry().Name;              
 
            }
        }
[+][-]05.23.2008 at 06:39AM PDT, ID: 21631974

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Visual Studio 2008, .NET Framework 3.x versions
Tags: Microsoft, C#, Visual Studio 2008, .NET 3.5
Sign Up Now!
Solution Provided By: Trypsim
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628