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
{
  string   Caption;
  string   Description;
  datetime InstallDate;
  string   Status;
  string   CreationClassName;
  string   Name;
  string   SystemCreationClassName;
  string   SystemName;
  uint32   Type;
  boolean  ByteCount;
  string   HostAddress;
  uint32   PortNumber;
  uint32   Protocol;
  string   Queue;
  string   SNMPCommunity;
  uint32   SNMPDevIndex;
  boolean  SNMPEnabled;
};

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), DisplayName ("Caption")

A short textual description of the object.

This property is inherited from CIM_ManagedSystemElement.

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

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

This property is inherited from CIM_ServiceAccessPoint.

Description
Data type: string
Access type: Read-only
Qualifiers: DisplayName ("Description")

A textual description of the object.

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
Qualifiers: MappingStrings ("MIF.DMTF|ComponentID|001.5"), DisplayName ("Install Date")

Indicates when the object was installed. Lack of a value does not indicate that the object is not installed.

This property is inherited from CIM_ManagedSystemElement.

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

Uniquely identifies the service access point and provides an indication of the functionality that is managed. This functionality is described in more detail in the object's Description property.

This property is inherited from CIM_ServiceAccessPoint.

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.

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), DisplayName ("Status")

String that indicates the current status of the object. Operational and non-operational status can be defined. Operational status can include "OK", "Degraded", and "Pred Fail". "Pred Fail" indicates that an element is functioning properly, but is predicting a failure (for example, a SMART-enabled hard disk drive).

Non-operational status can include "Error", "Starting", "Stopping", and "Service". "Service" can apply during disk mirror-resilvering, reloading a user permissions list, or other administrative work. Not all such work is online, but the managed element is neither "OK" nor in one of the other states.

This property is inherited from CIM_ManagedSystemElement.

Values include the following:

OK ("OK")

Error ("Error")

Degraded ("Degraded")

Unknown ("Unknown")

Pred Fail ("Pred Fail")

Starting ("Starting")

Stopping ("Stopping")

Service ("Service")

Stressed ("Stressed")

NonRecover ("NonRecover")

No Contact ("No Contact")

Lost Comm ("Lost Comm")

SystemCreationClassName
Data type: string
Access type: Read-only
Qualifiers: Propagated ("CIM_System.CreationClassName"), CIM_Key, MaxLen (256)

The scoping system's creation class name.

This property is inherited from CIM_ServiceAccessPoint.

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

The scoping system's name.

This property is inherited from CIM_ServiceAccessPoint.

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

Type of SAP, such as attached or redirected.

This property is inherited from CIM_ServiceAccessPoint.

Write (1)

Read (2)

Redirected (4)

Net_Attached (8)

unknown (16)

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 2008

Namespace

Root\CIMV2

MOF

Win32_Printer.mof

DLL

CIMWin32.dll

See also

CIM_ServiceAccessPoint
Computer System Hardware Classes

 

 

Show: