IADsPrintQueue interface

The IADsPrintQueue interface represents a printer on a network. It is a dual interface that inherits from IADs. The property methods of this interface enables you to access data about a printer, for example printer model, physical location, and network address.

Members

The IADsPrintQueue interface inherits from IDispatch and IADs. IADsPrintQueue also has these types of members:

Methods

The IADsPrintQueue interface has these methods.

MethodDescription
Get

Retrieves the value for a property by name.

GetEx

Retrieves the value for a single or multi-valued property by name.

GetInfo

Loads the property values of this object from the underlying directory store.

GetInfoEx

Loads specific property values of this object from the underlying directory store.

Put

Sets the value for a property by name.

PutEx

Sets the value for a single or multi-valued property by name.

SetInfo

Persists the changes on this object to the underlying directory store.

 

Properties

The IADsPrintQueue interface has these properties.

PropertyAccess typeDescription

AdsPath

Read-only

Retrieves the object ADsPath that uniquely identifies this object.

BannerPage

Read/write

Retrieves and sets the file system path to the banner page file used to separate jobs.

Class

Read-only

Retrieves the name of the object schema class.

Datatype

Read/write

Retrieves and sets the data type that can be processed by this print queue.

DefaultJobPriority

Read/write

Retrieves and sets the default priority assigned to each print job.

Description

Read/write

Retrieves and sets the description of this print queue.

GUID

Read-only

Retrieves the GUID of the object as stored in the underlying directory store.

Location

Read/write

Retrieves and sets the administrator description of the print queue location.

Model

Read/write

Retrieves and sets the name of the driver used by this print queue.

Name

Read-only

Retrieves the object relative name.

NetAddresses

Read/write

Retrieves and sets the binding data.

Parent

Read-only

Retrieves the ADsPath string for the object parent.

PrintDevices

Read/write

Retrieves and sets the names of print devices that this print queue uses as spooling devices.

PrinterPath

Read/write

Retrieves and sets the path where a shared printer can be accessed.

PrintProcessor

Read/write

Retrieves and sets the print processor associated with this print queue.

Priority

Read/write

Retrieves and sets the priority of this printer object job queue for connected devices.

Schema

Read-only

Retrieves the ADsPath string to the schema class object for this object.

StartTime

Read/write

Retrieves and sets the time when the print queue starts processing jobs.

UntilTime

Read/write

Retrieves and sets the time at which the print queue stops processing jobs.

 

Remarks

Use this interface to browse a collection of print jobs in the print queue. To control a printer across a network, use the IADsPrintQueueOperations interface. To obtain a collection of the print jobs, call the IADsPrintQueueOperations::PrintJobs method.

In Windows, a printer, or a print queue, is managed by a host computer. If the path to a print queue is known, bind to it as to any other ADSI objects.

The following Visual Basic code example shows the bind operation.


Dim pq as IADsPrintQueue
Set pq = GetObject("WinNT://aMachine/aPrinter")

The following C++ code example shows the bind operation.


IADsPrintQueue *pq;
LPWSTR adsPath = L"WinNT://aMachine/aPrinter";
HRESULT hr = ADsGetObject(adsPath,
                          IID_IADsPrintQueue,
                          (void**)&pq);

Aa706091.wedge(en-us,VS.85).gifTo enumerate all print queues on a given computer

  1. Bind to the computer object.
  2. Determine if the computer contains any "PrintQueue" objects.
  3. Enumerate all the found printer objects.

Examples

The following code example enumerates printers on a given computer.


Dim cont As IADsContainer
Dim pq As IADsPrintQueue

On Error GoTo Cleanup
 
' Bind to the computer object
Set cont = GetObject("WinNT://fabrikam1,computer")

cont.Filter = Array("PrintQueue")

For Each p In cont
   Set pq = GetObject(p.ADsPath)
   MsgBox pq.Name & " is a " & pq.Model
Next p

Cleanup:
    If (Err.Number<>0) Then
        MsgBox("An error has occurred. " & Err.Number)
    End If
    Set cont = Nothing
    Set pq = Nothing

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsPrintQueue is defined as B15160D0-1226-11CF-A985-00AA006BC149

See also

IDispatch
IADs
IADsPrintQueueOperations
IADsPrintQueueOperations::PrintJobs
IADsPrintQueue Property Methods

 

 

Show: