[英]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.
有12台打印服务器,每台服务器上有50多台打印机。 I used fol command but I get error
我使用了fol命令,但出现错误
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"
这意味着我必须将其写入12台服务器上(或者直到获得安装打印机的服务器为止”
When I used this command on my AD Role computer. 当我在AD角色计算机上使用此命令时。 it says
它说
the term "get-printer" is not recognized as the name of a cmdlet, function,
script file, or operable program.
the Get-Printer
cmdlet is one of the many that are not on earlier OSs. Get-Printer
cmdlet是较早版本的操作系统所没有的众多功能之一。 for instance, it is not available on win7ps5.1 at all. 例如,它根本不在win7ps5.1上可用。
you may want to use the CIM cmdlets to make the calls from your workstation. 您可能要使用CIM cmdlet从工作站进行呼叫。 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. 您可以在
-ComputerName
参数中为它提供一个列表,以从所有打印服务器获取信息。
while it seems unlikely, you can use the WMI version of that command if you need to run it on a ps2.0 system. 尽管似乎不太可能,但是如果需要在ps2.0系统上运行该命令,则可以使用该命令的WMI版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.