Score:0

I'm trying to find the printer share name with the IP address of a network connected printer

cn flag

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.

Score:0
us flag

Sometimes it's the little things.

It will work with single quotes instead of double quotes. I'd have to really dig into the language specification to figure out why that is.

Also, in this specific case, there's not a lot of value to the "Select Name,Portname" command since you're not doing much with that array. You can save yourself some time by omitting it.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.