< Back

Add-PrinterPort

Wed Jan 30, 2019 5:58 pm

NAME Add-PrinterPort



SYNOPSIS

Installs a printer port on the specified computer.





SYNTAX

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



Add-PrinterPort [-Name] <String> [-PrinterHostAddress] <String> [-CimSession <CimSession[]>] [-ComputerName <String>] [-PortNumber <UInt32>] [-SNMP

<UInt32>] [-SNMPCommunity <String>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]



Add-PrinterPort [-HostName] <String> [-PrinterName] <String> [-CimSession <CimSession[]>] [-ComputerName <String>] [-ThrottleLimit <Int32>] [-Confirm]

[-WhatIf] [<CommonParameters>]



Add-PrinterPort [-Name] <String> [-LprHostAddress] <String> [-LprQueueName] <String> [-CimSession <CimSession[]>] [-ComputerName <String>]

[-LprByteCounting] [-SNMP <UInt32>] [-SNMPCommunity <String>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Add-PrinterPort cmdlet creates a 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.



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



You do not need administrator credentials to run Add-PrinterPort.





PARAMETERS

-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.



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 you do not specify a value, the printer port is added to the local computer.



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.



Required? true

Position? 1

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-LprByteCounting [<SwitchParameter>]

Indicates that this cmdlet enables LPR byte counting for a TCP/IP printer port in LPR mode.



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.



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.



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.



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.



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.



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.



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.



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.



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.



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.Prompts you for confirmation before running the cmdlet.



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.Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value false

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None



This cmdlet accepts no input objects.





OUTPUTS

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



This cmdlet returns an object that contains the new printer port.





Example 1: Create a local printer port



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



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





Example 2: Create a TCP printer port



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



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







RELATED LINKS

Get-PrinterPort

Remove-PrinterPort