Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Add-PrinterPort

Add-PrinterPort

msft_printerporttasks_v1.0.cdxml

Synopsis

Installs a printer port on the specified computer.

Syntax

Add-PrinterPort [-Name] [-AsJob] [-CimSession] [-ComputerName] [-ThrottleLimit] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-PrinterPort [-Name] [-PrinterHostAddress] [-AsJob] [-CimSession] [-ComputerName] [-PortNumber] [-SNMP] [-SNMPCommunity] [-ThrottleLimit] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-PrinterPort [-HostName] [-PrinterName] [-AsJob] [-CimSession] [-ComputerName] [-ThrottleLimit] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-PrinterPort [-Name] [-LprHostAddress] [-LprQueueName] [-AsJob] [-CimSession] [-ComputerName] [-LprByteCounting] [-SNMP] [-SNMPCommunity] [-ThrottleLimit] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Add-PrinterPort cmdlet creates a new printer port on the specified computer. You can create a local printer port, a printer port using TCP, and LPR printer ports by using Add-PrinterPort cmdlet.

You cannot use wildcard characters with Add-PrinterPort. You can use Add-PrinterPort in a Windows PowerShell remoting session.

You do not need administrator privileges to use Add-PrinterPort.

Parameters

-AsJob <SwitchParameter>

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-CimSession <CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ComputerName <String>

Specifies the name of the computer to which to add the printer port. If not specified, the printer port is added to the local computer.

Aliases

CN

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-HostName <String>

Specifies the host name of the computer on which to add LPR printer port.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-LprByteCounting <SwitchParameter>

Enables LPR byte counting for a TCP/IP printer port in LPR mode.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-LprHostAddress <String>

Specifies the LPR host address when installing a TCP/IP printer port in LPR mode.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-LprQueueName <String>

Specifies the LPR queue name when installing a TCP/IP printer port in LPR mode.

Aliases

None

Required?

true

Position

3

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String>

Specifies the name of the printer port to install on the specified computer.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PortNumber <UInt32>

Specifies the TCP/IP port number for the printer port added to the specified computer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PrinterHostAddress <String>

Specifies the host address of the TCP/IP printer port added to the specified computer.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PrinterName <String>

Specifies the name of the printer installed on the LPR printer port.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-SNMP <UInt32>

Enables SNMP and specifies the index for TCP/IP printer port management.

Aliases

SNMPIndex

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-SNMPCommunity <String>

Specifies the SNMP community name for TCP/IP printer port management.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ThrottleLimit <Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_PrinterPort

Notes

None

Examples

Example 1: Create a local printer port

This command creates a local printer port named LocalPort on the local computer.

PS C:\> Add-PrinterPort -Name "LocalPort:"

Example 2: Create a TCP printer port

This command creates a TCP printer port named TCPPort: with an IP address of 192.168.100.100 on the computer.

PS C:\> Add-PrinterPort -Name "TCPPort:" -PrinterHostAddress "192.168.100.100"

Online Version
Get-PrinterPort
Remove-PrinterPort