Share via


Invoke-MgRedirectPrintPrinterJob

Redirect a print job to a different printer. Redirecting a print job will only succeed if there is a printTask in a processing state on the associated print job, started by a trigger that the requesting app created. For details about how to use this API to add pull printing support to Universal Print, see Extending Universal Print to support pull printing.

Note

To view the beta release of this cmdlet, view Invoke-MgBetaRedirectPrintPrinterJob

Syntax

RedirectExpanded (Default)

Invoke-MgRedirectPrintPrinterJob
    -PrintJobId <string>
    -PrinterId <string>
    [-ResponseHeadersVariable <string>]
    [-AdditionalProperties <hashtable>]
    [-Configuration <IMicrosoftGraphPrintJobConfiguration>]
    [-DestinationPrinterId <string>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Redirect

Invoke-MgRedirectPrintPrinterJob
    -PrintJobId <string>
    -PrinterId <string>
    -BodyParameter <IPathsB8DgksPrintPrintersPrinterIdJobsPrintjobIdMicrosoftGraphRedirectPostRequestbodyContentApplicationJsonSchema>
    [-ResponseHeadersVariable <string>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RedirectViaIdentityExpanded

Invoke-MgRedirectPrintPrinterJob
    -InputObject <IDevicesCloudPrintIdentity>
    [-ResponseHeadersVariable <string>]
    [-AdditionalProperties <hashtable>]
    [-Configuration <IMicrosoftGraphPrintJobConfiguration>]
    [-DestinationPrinterId <string>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RedirectViaIdentity

Invoke-MgRedirectPrintPrinterJob
    -InputObject <IDevicesCloudPrintIdentity>
    -BodyParameter <IPathsB8DgksPrintPrintersPrinterIdJobsPrintjobIdMicrosoftGraphRedirectPostRequestbodyContentApplicationJsonSchema>
    [-ResponseHeadersVariable <string>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Redirect a print job to a different printer. Redirecting a print job will only succeed if there is a printTask in a processing state on the associated print job, started by a trigger that the requesting app created. For details about how to use this API to add pull printing support to Universal Print, see Extending Universal Print to support pull printing.

Examples

Example 1: Code snippet


Import-Module Microsoft.Graph.Devices.CloudPrint

$params = @{
	destinationPrinterId = "9a3b3956-ce5b-4d06-a605-5b0bd3e9ddea"
	configuration = @{
		feedOrientation = "longEdgeFirst"
		pageRanges = @(
			@{
				start = 1
				end = 1
			}
		)
		quality = "medium"
		dpi = 600
		orientation = "landscape"
		copies = 1
		duplexMode = "oneSided"
		colorMode = "blackAndWhite"
		inputBin = "by-pass-tray"
		outputBin = "output-tray"
		mediaSize = "A4"
		margin = @{
			top = 0
			bottom = 0
			left = 0
			right = 0
		}
		mediaType = "stationery"
		finishings = $null
		pagesPerSheet = 1
		multipageLayout = "clockwiseFromBottomLeft"
		collate = $false
		scaling = "shrinkToFit"
		fitPdfToPage = $false
	}
}

Invoke-MgRedirectPrintPrinterJob -PrinterId $printerId -PrintJobId $printJobId -BodyParameter $params

This example shows how to use the Invoke-MgRedirectPrintPrinterJob Cmdlet.

Parameters

-AdditionalProperties

Additional Parameters

Parameter properties

Type:System.Collections.Hashtable
Supports wildcards:False
DontShow:False

Parameter sets

RedirectViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RedirectExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BodyParameter

To construct, see NOTES section for BODYPARAMETER properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IPathsB8DgksPrintPrintersPrinterIdJobsPrintjobIdMicrosoftGraphRedirectPostRequestbodyContentApplicationJsonSchema
Supports wildcards:False
DontShow:False

Parameter sets

RedirectViaIdentity
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
Redirect
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Break

Wait for .NET debugger to attach

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Configuration

printJobConfiguration To construct, see NOTES section for CONFIGURATION properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IMicrosoftGraphPrintJobConfiguration
Supports wildcards:False
DontShow:False

Parameter sets

RedirectViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RedirectExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationPrinterId

Redirect a print job to a different printer. Redirecting a print job will only succeed if there is a printTask in a processing state on the associated print job, started by a trigger that the requesting app created. For details about how to use this API to add pull printing support to Universal Print, see Extending Universal Print to support pull printing.

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

RedirectViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RedirectExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Headers

Optional headers that will be added to the request.

Parameter properties

Type:System.Collections.IDictionary
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-HttpPipelineAppend

SendAsync Pipeline Steps to be appended to the front of the pipeline

Parameter properties

Type:

Microsoft.Graph.PowerShell.Runtime.SendAsyncStep[]

Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HttpPipelinePrepend

SendAsync Pipeline Steps to be prepended to the front of the pipeline

Parameter properties

Type:

Microsoft.Graph.PowerShell.Runtime.SendAsyncStep[]

Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IDevicesCloudPrintIdentity
Supports wildcards:False
DontShow:False

Parameter sets

RedirectViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
RedirectViaIdentity
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-PrinterId

The unique identifier of printer

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

RedirectExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Redirect
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrintJobId

The unique identifier of printJob

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

RedirectExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Redirect
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Proxy

The URI for the proxy server to use

Parameter properties

Type:System.Uri
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProxyCredential

Credentials for a proxy server to use for the remote call

Parameter properties

Type:System.Management.Automation.PSCredential
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProxyUseDefaultCredentials

Use the default credentials for the proxy

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseHeadersVariable

Optional Response Headers Variable.

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False
Aliases:RHV

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Graph.PowerShell.Models.IDevicesCloudPrintIdentity

{{ Fill in the Description }}

Microsoft.Graph.PowerShell.Models.IPathsB8DgksPrintPrintersPrinterIdJobsPrintjobIdMicrosoftGraphRedirectPostRequestbodyContentApplicationJsonSchema

{{ Fill in the Description }}

System.Collections.IDictionary

{{ Fill in the Description }}

Outputs

Microsoft.Graph.PowerShell.Models.IMicrosoftGraphPrintJob

{{ Fill in the Description }}

Notes

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODYPARAMETER <IPathsB8DgksPrintPrintersPrinterIdJobsPrintjobIdMicrosoftGraphRedirectPostRequestbodyContentApplicationJsonSchema>: . [(Any) <Object>]: This indicates any property can be added to this object. [Configuration <IMicrosoftGraphPrintJobConfiguration>]: printJobConfiguration [(Any) <Object>]: This indicates any property can be added to this object. [Collate <Boolean?>]: Whether the printer should collate pages wehen printing multiple copies of a multi-page document. [ColorMode <String>]: printColorMode [Copies <Int32?>]: The number of copies that should be printed. Read-only. [Dpi <Int32?>]: The resolution to use when printing the job, expressed in dots per inch (DPI). Read-only. [DuplexMode <String>]: printDuplexMode [FeedOrientation <String>]: printerFeedOrientation [Finishings <String[]>]: Finishing processes to use when printing. [FitPdfToPage <Boolean?>]: True to fit each page of a PDF document to a physical sheet of media; false to let the printer decide how to lay out impressions. [InputBin <String>]: The input bin (tray) to use when printing. See the printer's capabilities for a list of supported input bins. [Margin <IMicrosoftGraphPrintMargin>]: printMargin [(Any) <Object>]: This indicates any property can be added to this object. [Bottom <Int32?>]: The margin in microns from the bottom edge. [Left <Int32?>]: The margin in microns from the left edge. [Right <Int32?>]: The margin in microns from the right edge. [Top <Int32?>]: The margin in microns from the top edge. [MediaSize <String>]: The media size to use when printing. Supports standard size names for ISO and ANSI media sizes. Valid values listed in the printerCapabilities topic. [MediaType <String>]: The default media (such as paper) type to print the document on. [MultipageLayout <String>]: printMultipageLayout [Orientation <String>]: printOrientation [OutputBin <String>]: The output bin to place completed prints into. See the printer's capabilities for a list of supported output bins. [PageRanges <IMicrosoftGraphIntegerRange[]>]: The page ranges to print. Read-only. [End <Int64?>]: The inclusive upper bound of the integer range. [Start <Int64?>]: The inclusive lower bound of the integer range. [PagesPerSheet <Int32?>]: The number of document pages to print on each sheet. [Quality <String>]: printQuality [Scaling <String>]: printScaling [DestinationPrinterId <String>]:

CONFIGURATION <IMicrosoftGraphPrintJobConfiguration>: printJobConfiguration [(Any) <Object>]: This indicates any property can be added to this object. [Collate <Boolean?>]: Whether the printer should collate pages wehen printing multiple copies of a multi-page document. [ColorMode <String>]: printColorMode [Copies <Int32?>]: The number of copies that should be printed. Read-only. [Dpi <Int32?>]: The resolution to use when printing the job, expressed in dots per inch (DPI). Read-only. [DuplexMode <String>]: printDuplexMode [FeedOrientation <String>]: printerFeedOrientation [Finishings <String[]>]: Finishing processes to use when printing. [FitPdfToPage <Boolean?>]: True to fit each page of a PDF document to a physical sheet of media; false to let the printer decide how to lay out impressions. [InputBin <String>]: The input bin (tray) to use when printing. See the printer's capabilities for a list of supported input bins. [Margin <IMicrosoftGraphPrintMargin>]: printMargin [(Any) <Object>]: This indicates any property can be added to this object. [Bottom <Int32?>]: The margin in microns from the bottom edge. [Left <Int32?>]: The margin in microns from the left edge. [Right <Int32?>]: The margin in microns from the right edge. [Top <Int32?>]: The margin in microns from the top edge. [MediaSize <String>]: The media size to use when printing. Supports standard size names for ISO and ANSI media sizes. Valid values listed in the printerCapabilities topic. [MediaType <String>]: The default media (such as paper) type to print the document on. [MultipageLayout <String>]: printMultipageLayout [Orientation <String>]: printOrientation [OutputBin <String>]: The output bin to place completed prints into. See the printer's capabilities for a list of supported output bins. [PageRanges <IMicrosoftGraphIntegerRange[]>]: The page ranges to print. Read-only. [End <Int64?>]: The inclusive upper bound of the integer range. [Start <Int64?>]: The inclusive lower bound of the integer range. [PagesPerSheet <Int32?>]: The number of document pages to print on each sheet. [Quality <String>]: printQuality [Scaling <String>]: printScaling

INPUTOBJECT <IDevicesCloudPrintIdentity>: Identity Parameter [GroupId <String>]: The unique identifier of group [PrintConnectorId <String>]: The unique identifier of printConnector [PrintDocumentId <String>]: The unique identifier of printDocument [PrintJobId <String>]: The unique identifier of printJob [PrintOperationId <String>]: The unique identifier of printOperation [PrintServiceEndpointId <String>]: The unique identifier of printServiceEndpoint [PrintServiceId <String>]: The unique identifier of printService [PrintTaskDefinitionId <String>]: The unique identifier of printTaskDefinition [PrintTaskId <String>]: The unique identifier of printTask [PrintTaskTriggerId <String>]: The unique identifier of printTaskTrigger [PrinterId <String>]: The unique identifier of printer [PrinterShareId <String>]: The unique identifier of printerShare [UserId <String>]: The unique identifier of user