Another advantage of sharing the printer(s) on the print server is printer discovery. If you publish the printer in AD it makes it fairly easy for a user to discover and add the printer.
Also, this is my opinion but it's based on my experience in larger corporate environments: I think you'll find that sharing printers from a print server (or print servers) is the standard way of making them available to users. I've never seen a corporate environment (with more then a few users) that had users connecting directly to the printer. I would think that would make printer management, control and troubleshooting more cumbersome. A big part of managing any IT infrastructure is efficiency and having users connecting directly to the printers isn't very efficient from a manageability perspective.
SOHO environments, where there's no AD or servers of any kind are more likely to have users conected directly to the printer(s).
You have the IP address of the printer itself (for management or for direct printing) and want to know what Windows print server it is being shared out on? Is that correct?
You can "manually" search each print server (which I figure would be easier than querying all of them since I figure you would probably have some idea logically of where it might reside, such as narrowing it down to 5 print servers that are local to the subnet the printer is on).
Using Powershell (where $printservername is the likely print server hostname):
Get-WMIObject -class Win32_Printer -computer $printservername | Select Name,DriverName,PortName | Where-Object {$_.PortName -eq "IP_x.x.x.x"}
Note that you might go ahead and run it without the Where-Object portion to see what the PortName output looks like but it should be similar to IP_10.10.10.10 or similar.
If you don't get any results, then that print server isn't the one hosting that IP address.
UPDATE: since you wanted a input file, I went ahead and did that for you as well. You'll need 2 input files, one with the list of print servers and one with the IP address listed or the IP_x.x.x.x listed. Please realize that if you use something else for your port names such as hostname/DNS you'll need to put those into your printerIP.txt file as such. If you don't know the exact PortName then this script won't return any result. Also, only put one "portname" in the printerIP.txt or it will not return any matching result.
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Script: Find-WhichPrintServer.ps1
# Author: TheCleaner, serverfault.com
# Date: 1/16/2013
# Comments: This script will query each of the computers in the input file and look for a particular printer's IP address on that print server. If found it will output the name of the print server and printer name and info
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$printservers = Get-Content -Path C:\PSinput\PrintServers.txt
$printerIP = Get-Content -Path C:\PSinput\printerIP.txt #note this must be the correct format such as IP_x.x.x.x
Get-WMIObject -class Win32_Printer -computer $printservers | Select SystemName,Name,DriverName,PortName | Where-Object {$_.PortName -eq $printerIP} |
Format-Table -Property SystemName, PortName, Name, DriverName -AutoSize
Hope that helps!
Best Answer
Whatever you do, I would make sure the printer has it's name on it in very large clear lettering where end-users can see it - the bigger and more obtrusive the better - I use a large black on yellow label printer. Make sure this name is used consistently in software.
Old printers do sometimes get replaced and re-used in other locations. You have to have the discipline to rename them and re-label them.
I tend to keep records in an online web-page or Wiki that is easy for everyone to view and easy for me to update.
So long as you have clear labelling, diligent relabelling and well-maintained easily-found online documentation, you can use any naming system, even "printer_1" .. "printer_134" ..