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

Add-Printer

msft_printer_v1.0.cdxml

Synopsis

Adds a printer to the specified computer.

Syntax

Add-Printer [-ConnectionName] [-AsJob] [-CimSession] [-ThrottleLimit] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-Printer [-Name] [-DriverName] [-AsJob] [-BranchOfficeOfflineLogSizeMB] [-CimSession] [-Comment] [-ComputerName] [-Datatype] [-DisableBranchOfficeLogging] [-KeepPrintedJobs] [-Location] [-PermissionSDDL] [-PrintProcessor] [-Priority] [-Published] [-RenderingMode] [-SeparatorPageFile] [-Shared] [-ShareName] [-StartTime] [-ThrottleLimit] [-UntilTime] [-PortName] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-Printer [-Name] [-AsJob] [-BranchOfficeOfflineLogSizeMB] [-CimSession] [-Comment] [-ComputerName] [-Datatype] [-DeviceURL] [-DeviceUUID] [-DisableBranchOfficeLogging] [-KeepPrintedJobs] [-Location] [-PermissionSDDL] [-PrintProcessor] [-Priority] [-Published] [-RenderingMode] [-SeparatorPageFile] [-Shared] [-ShareName] [-StartTime] [-ThrottleLimit] [-UntilTime] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Add-Printer cmdlet adds a printer to a specified computer. You can add both local printers and connections to network-based printers.

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

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

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

-BranchOfficeOfflineLogSizeMB <UInt32>

Specifies the maximum size, in megabytes, of the branch office remote offline log file for this printer. You cannot specify this parameter for unshared queues or queues that do not have branch office enabled.

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

-Comment <String>

Specifies the text to add to the Comment field for the specified printer.

Aliases

None

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.

Aliases

CN

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ConnectionName <String>

Specifies the name of a shared printer to which to connect. This parameter is required.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Datatype <String>

Specifies the data type the printer uses to record print jobs.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeviceURL <String>

Adds a WSD (Web Services on Devices) printer to the specified computer. The URL is used for directed discovery.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeviceUUID <String>

Specifies the multicast UUID for device detection for the WSD port.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DisableBranchOfficeLogging <SwitchParameter>

Indicates that branch office remote logging is disabled. You cannot specify this parameter for unshared queues.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DriverName <String>

Specifies the name of the printer driver for the printer.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-KeepPrintedJobs <SwitchParameter>

Specifies whether the print jobs in the queue are kept.

Aliases

None

Required?

false

Position

named

Default value

False

Accept pipeline input?

false

Accept wildcard characters?

false

-Location <String>

Specifies the location of the printer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String>

Specifies the name of the printer to add.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

false

-PermissionSDDL <String>

Specifies the permissions for the printer as an SDDL (Security Descriptor Definition Language) string.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PortName <String>

Specifies the name of the port used or created for the printer.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PrintProcessor <String>

Specifies the name of the print processor used by the printer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Priority <UInt32>

Specifies the relative queue priority.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Published <SwitchParameter>

Specifies whether or not the printer is published in the network directory service.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-RenderingMode <RenderingModeEnum>

Specifies the rendering mode for the printer. You can specify one of the following three rendering modes: SSR (Service Side Rendering), CSR (Client Side Rendering), or Branch Office

Aliases

None

Required?

false

Position

named

Default value

0

Accept pipeline input?

false

Accept wildcard characters?

false

-SeparatorPageFile <String>

Specifies the path to and name of the separator page to be used by the printer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ShareName <String>

Specifies the name by which to share the printer on the network. To share a printer, specify the Shared parameter.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Shared <SwitchParameter>

Indicates whether to share the printer on the network. You can determine the name by which the printer is shared by specifying ShareName. If ShareName is not specified, the name of the printer is used as the share name.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-StartTime <UInt32>

Specifies the starting time of printer availability.

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

-UntilTime <UInt32>

Specifies the ending time of printer availability.

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


Return Type


Notes

None

Examples

Example 1: Add a printer to a local computer

This command adds a printer with name "mxdw2" to the local computer. The "mxdw" printer uses the "Microsoft XPS Document Writer v4" driver and the "portprompt:" port.

The “portprompt:” port prompts for a file name to save the XPS document when printing to the XPS printer.

PS C:\> Add-Printer -Name "mxdw 2" -DriverName "Microsoft XPS Document Writer v4" -PortName "portprompt:"

Example 2: Add a new network printer connection

This command adds a new printer by specifying the name of a print server and a shared printer on that server.

PS C:\> Add-Printer -ConnectionName \\printServer\printerName

Online Version
Get-Printer
Set-Printer
Remove-Printer
Rename-Printer