Skip to content

Remove-UnusedPrinterPorts

SYNOPSIS

Remove unused printer ports from a specified print server.

SYNTAX

Remove-UnusedPrinterPorts [-Server] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function retrieves a list of all unused TCP/IP printer ports on the specified print server and removes them. It ensures that only ports not associated with any printers are deleted.

EXAMPLES

EXAMPLE 1

Remove-UnusedPrinterPorts -Server "SRVPRINT01"

Removes all unused TCP/IP printer ports from the print server "SRVPRINT01".

EXAMPLE 2

"SRVPRINT01", "SRVPRINT02" | Remove-UnusedPrinterPorts

Removes all unused TCP/IP printer ports from the print servers "SRVPRINT01" and "SRVPRINT02".

PARAMETERS

-Server

The name of the print server from which unused printer ports will be removed.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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.

INPUTS

OUTPUTS

NOTES