Skip to content

Get-PrinterList

SYNOPSIS

Retrieve a list of printers from all servers where the name matches 'print'.

SYNTAX

Get-PrinterList [[-Filter] <Object>] [[-Properties] <Object>] [-Server <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

This function retrieves printers from all servers where the name matches 'print'. It allows filtering based on specific conditions and includes customizable properties for the output. The function queries Active Directory for print servers and uses the `Get-Printer` cmdlet to retrieve printer details.

EXAMPLES

EXAMPLE 1

Get-PrinterList -Filter "Shared -eq $true"

Retrieves a list of shared printers from all servers where the name matches 'print'.

EXAMPLE 2

Get-PrinterList -Properties @('Name', 'Location') -Server "SRVPRINT01"

Retrieves the `Name` and `Location` properties of printers from the server "SRVPRINT01".

EXAMPLE 3

Get-PrinterList -Server "*PRINT*" -Filter "JobCount -gt 0"

Retrieves printers with active jobs from all servers where the name matches 'print'.

PARAMETERS

-Filter

Conditions that should match the printers. If specified, only printers matching the filter will be included in the output.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Properties

Specifies the properties to include in the output. Defaults to common printer properties such as `Name`, `PortName`, `JobCount`, etc.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: @('Name', 'PortName', 'JobCount', 'PrinterStatus', 'Shared', 'ShareName', 'ComputerName', 'DriverName', 'Location', 'Comment')
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Server

The name of the server(s) to query for printers. Defaults to 'PRINT'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: *PRINT*
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.

INPUTS

OUTPUTS

NOTES