I often need to find the Windows print queue name or share name of a printer connected to our network using just the IP address of the printer. I can use PowerShell to list all of the printers on a server but there are hundreds to read through (and multiple servers) to find a specific IP.
I'm trying to use this command in PowerShell but when I run it, PS just returns to the prompt with no output (and no error message).
Get-Printer -Computername %computername | Select Name,Portname | Where-Object {$_.PortName -eq "IP address"}
I'm a complete newb with PowerShell and scripting in general. This seems like it should work but I'm not sure why it's not giving me an output.