jaykio77
jaykio77

Reputation: 391

Find print server on which a printer is installed using powershell in Domain

I need to quickly find out the server on which a printer is installed in my Domain. There are 12 print servers with more than 50 printers on each. I used fol command but I get error

PS C:\>Get-Printer -Name "PayRoll_Sec_ptr"

But this command give me result only when used on the particular server on which the printer is installed. That means I have to write it on 12 servers (or till I get the server where the printer is installed"

When I used this command on my AD Role computer. it says

the term "get-printer" is not recognized as the name of a cmdlet, function, 

 script file, or operable program.

Upvotes: 0

Views: 6858

Answers (1)

Lee_Dailey
Lee_Dailey

Reputation: 7479

the Get-Printer cmdlet is one of the many that are not on earlier OSs. for instance, it is not available on win7ps5.1 at all.

you may want to use the CIM cmdlets to make the calls from your workstation. this ...

Get-CimInstance -ClassName CIM_Printer -ComputerName 'LocalHost', '127.0.0.1'

will get the printers from the systems listed. you can feed it a list in the -ComputerName parameter to get info from all your print servers.

while it seems unlikely, you can use the WMI version of that command if you need to run it on a ps2.0 system.

Upvotes: 2

Related Questions