Clear-PrintQueue
SYNOPSIS
Clear print jobs from a specified printer queue.
SYNTAX
Clear-PrintQueue [-Name] <String> [[-ComputerName] <String[]>] [-ErrorOnly] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
This function clears print jobs from the specified printer queue on one or more print servers. It supports filtering to remove only jobs with errors and uses the `PrintManagement` module for operations.
EXAMPLES
EXAMPLE 1
Clears all print jobs from the queue of "Printer1" on the server "SRVPRINT01".
EXAMPLE 2
Clears only the print jobs with errors from the queue of "Printer2" on the default list of servers.
EXAMPLE 3
Clears only the print jobs with errors from the queue of "Printer3" on the servers "SRVPRINT01" and "SRVPRINTRP01".
PARAMETERS
-Name
The name of the printer whose queue will be cleared.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-ComputerName
The name(s) of the print server(s) where the printer resides. Defaults to a predefined list of servers.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: @('SRVPRINT01', 'SRVPRINTRP01', 'SRVPRINTRP02', 'SRVPRINTRP03', 'SRVPRINTRP04', 'SRVPRINTRP05', 'SRVPRINTRP06', 'SRVPRINTRP', 'SRVPRINTOND02')
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-ErrorOnly
A switch to indicate whether only print jobs with errors should be removed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.