Win32_TCPIPPrinterPort class

The Win32_TCPIPPrinterPort WMI class represents a TCP/IP service access point.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

class Win32_TCPIPPrinterPort : CIM_ServiceAccessPoint
{
  boolean  ByteCount;
  string   Caption;
  string   CreationClassName;
  string   Description;
  string   HostAddress;
  datetime InstallDate;
  string   Name;
  uint32   PortNumber;
  uint32   Protocol;
  string   Queue;
  string   SNMPCommunity;
  uint32   SNMPDevIndex;
  boolean  SNMPEnabled;
  string   Status;
  string   SystemCreationClassName;
  string   SystemName;
  uint32   Type;
};

Members

The Win32_TCPIPPrinterPort class has these types of members:

Properties

The Win32_TCPIPPrinterPort class has these properties.

ByteCount
Data type: boolean
Access type: Read-only

If TRUE, the computer counts the bytes in a document before sending them to the printer and the printer reports back the number of bytes actually read. This capability is used for diagnostics when missing bytes are detected in the print output.

Caption
Data type: string
Access type: Read-only
Qualifiers: MaxLen (64)

Short description of the object. This property is inherited from CIM_ManagedSystemElement.

CreationClassName
Data type: string
Access type: Read-only
Qualifiers: MaxLen (256)

Name of the class or the subclass used in the creation of an instance. When used with the other key properties of this class, this property allows all instances of this class and its subclasses to be uniquely identified. This property is inherited from CIM_ServiceAccessPoint.

Description
Data type: string
Access type: Read/write

Detailed description of the functionality managed. This property is inherited from CIM_ManagedSystemElement.

HostAddress
Data type: string
Access type: Read-only

Address of the device or print server.

InstallDate
Data type: datetime
Access type: Read-only

Date and time the object was installed. This property does not require a value to indicate that the object is installed. This property is inherited from CIM_ManagedSystemElement.

Name
Data type: string
Access type: Read-only
Qualifiers: Key, MaxLen (256)

Identifier for the service access point that provides an indication of the functionality that is managed. This functionality is described in more detail in the Description property of the object. This property is inherited from CIM_ManagedSystemElement.

PortNumber
Data type: uint32
Access type: Read-only

Number of the TCP ports used by the port monitor to communicate with the device.

Protocol
Data type: uint32
Access type: Read-only

Printing protocol used. Some printers support only LPR.

ValueMeaning
1

RAW

Printing directly to a device or print server.

2

LPR

Legacy protocol, which is eventually replaced by RAW.

 

Queue
Data type: string
Access type: Read-only

Name of the print queue on the server when used with the LPR protocol.

SNMPCommunity
Data type: string
Access type: Read-only

Security level value for the device.

Example: "public'"

SNMPDevIndex
Data type: uint32
Access type: Read-only

SNMP index number of this device for the SNMP agent.

SNMPEnabled
Data type: boolean
Access type: Read-only

If TRUE, this printer supports RFC 1759 (Simple Network Management Protocol) and can provide rich status information from the device.

Status
Data type: string
Access type: Read-only
Qualifiers: MaxLen (10)

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", can apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states. This property is inherited from CIM_ManagedSystemElement.

The values are:

"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
"Stressed"
"NonRecover"
"No Contact"
"Lost Comm"
SystemCreationClassName
Data type: string
Access type: Read-only
Qualifiers: Propagated (CIM_System.CreationClassName) , MaxLen (256)

Creation class name of the scoping system. This property is inherited from CIM_ServiceAccessPoint.

SystemName
Data type: string
Access type: Read-only
Qualifiers: Propagated (CIM_System.Name) , MaxLen (256)

Name of the scoping system. This property is inherited from CIM_ServiceAccessPoint.

Type
Data type: uint32
Access type: Read-only
Qualifiers: Schema (Win32)

Bitmap that shows the type of service access point (SAP). This property is inherited from CIM_ServiceAccessPoint.

Value Meaning
1 0x1

Write

2 0x2

Read

4 0x4

Redirected

8 0x8

Net_Attached

16 0x10

Unknown

 

Remarks

The Win32_TCPIPPrinterPort class is derived from CIM_ServiceAccessPoint which derives from CIM_LogicalElement.

The SeLoadDriverPrivilege privilege is required to delete an instance of this WMI class. The following script snippet demonstrates how to make a connection to WMI that uses this privilege.

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate, (LoadDriver)}")

Examples

The following PowerShell sample removes a printer and the associated TCPIP printer port.


function Remove-PrinterAndPort{
    Param( $printername )
   $printer=gwmi win32_Printer -filter "name='HPDJ600'"
   $printer.Delete()
   $port=gwmi win32_tcpipprinterport -filter "name='$($printer.portname)'" -enableall
   $port.Delete()
}

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Computer System Hardware Classes

 

 

Show:
© 2014 Microsoft