时代在变,Windows也在变。如果您最近从Windows Server 2012和Windows 7 或 8(Windows 7 or 8)环境迁移到Windows Server 2019和Windows 10,情况会有所不同。
连接到网络打印机的旧方法仍然存在。它们也可能看起来有些不同。因此,我们将向您展示如何在 Windows 10 或Server 2019中连接到(Server 2019)网络打印机。我们最喜欢的方法是最后一种方法。
使用添加打印机和扫描仪(Use Add Printers & Scanners)
新的Windows 设置世界与(Windows Settings)控制面板(Control Panel)中的工作方式相同,但它看起来不同,足以引起一些人的困惑。请注意,如果这是在工作并且您不是管理员,则打印机必须在网络上并且已经安装了驱动程序。如果未安装,系统会提示您输入管理员帐户名和密码。
- 在开始(Start )菜单中,键入添加打印机(add printers)。当结果显示添加打印机或扫描仪(Add a printer or scanner)时,选择它。
- 当打印机和扫描仪(Printers & scanners )窗口打开时,选择添加打印机或扫描仪(Add a printer or scanner)。它将开始搜索可用的打印机。
- 即使所有可用的打印机都显示出来,它可能看起来仍在搜索。找到所需的打印机,(Find the printer needed, )选择它,然后将显示添加(Add )设备按钮。选择它。
- 打印机将安装。会有一个进度条,完成后会显示Ready。
通过网络共享连接到网络打印机(Connect to a Network Printer Through a Network Share)
这是一种安装打印机的方法,它与您可能习惯的不同。它要求打印机是共享(printer is shared)的并且在网络上。除非您是管理员,否则驱动程序需要安装在您的本地计算机或服务器上。您还需要知道共享的路径。它看起来像\\Print-Server-Name,其中 Print-Server-name 是服务器的名称。
- 打开文件资源管理器(File Explorer)。在位置栏中,输入打印机共享路径,然后按 Enter 键。文件资源管理器将找到(File Explorer will find)共享。
将显示所有共享打印机。
- 有两种选择:
- 安装单台打印机
- 一次安装(Install)多台打印机
要安装单个打印机,请双击它。
安装完成后,您将看到新安装的打印机的打印队列窗口。
- 要一次安装多台打印机,请通过单击并拖动打印机周围的矩形来选择打印机,或者在单独选择打印机时按住Ctrl键。右键单击并选择打开(Open )或直接按Enter键。
通过控制面板连接到网络打印机(Connect to Network Printer via Control Panel)
好的旧控制面板仍然存在。如果你以前用过它,你就知道该怎么做了。如果没有,几乎和通过Settings添加打印机一样。
- 打开开始(Start )菜单并选择控制面板(Control Panel)。如果它不存在,请开始输入control,它会显示出来。
- 在硬件(Hardware )类别中选择添加设备。(Add a device)
- 选择添加打印机(Add a printer)。
- 它将显示一系列打印机。选择需要的,然后选择Next。
打印机将开始安装。这可能需要几秒钟或几分钟。
- 成功窗口打开后,可以选择设置为默认打印机(Set as the default printer )和打印测试页(Print a test page)。如果需要,将打印机设置为默认值。打印测试页总是一个好主意。要退出,请选择完成(Finish)。
通过 IP 地址连接到网络打印机(Connect to Network Printer via IP Address)
您要安装的打印机可能不容易看到,但如果您有它的 IP 地址,您可以使用它来连接打印机。可能需要管理员权限。(Administrator)第一部分与通过控制面板(Control Panel)添加打印机相同,直到您进入选择打印机的步骤。让我们从那里捡起来。
- 在“添加设备(Add a device)”窗口中,选择“我想要的打印机未列出”(The printer that I want isn’t listed)。
- 如果需要管理员权限,请选择以管理员身份添加本地或网络打印机(Add a local or network printer as an administrator)。
否则,将显示下面的窗口。选择Add a printer using TCP/IP address or hostname然后选择下一步(Next)。
- 对于设备类型:(Device type:)有多种选择。Web 服务设备(Web Services Device)和Web 服务安全打印设备(Web Services Secure Print Device)用于特殊情况。如果你不知道这些是什么意思,你可能不需要它们。自动检测(Autodetect )也可能做出错误的选择。选择TCP/IP Device。
在主机名或 IP 地址:(Hostname or IP address: )字段中输入 IP 地址。请注意端口名称:(Port name: )字段如何自动填充输入的内容。端口名称可以保持不变或更改。在大多数情况下,查询打印机并自动选择要使用的驱动程序(Query the printer and automatically select the driver to use )保持选中状态。
有时,组织会使用通用打印机驱动程序来使事情变得更简单并使用更少的存储空间。它还使注册表小,登录时间更快。HP 通用打印驱动程序(HP Universal Print Driver)适用于 HP 和许多其他打印机。选择下一步(Next)。
它检测TCP/IP端口以查看它是否存在。
然后它检测所需的驱动程序模型。
- 通常,Windows会找到已安装的驱动程序,提供更换驱动程序的选项,或要求安装驱动程序。如果它已经在网络上,它可能已经安装了驱动程序。选择使用当前安装的驱动程序,(Use the driver that is currently installed )然后选择下一步(Next)。
- 它将自动选择打印机的名称。这可以根据需要进行更改。选择下一步(Next)。
真正的安装开始。
- 如果共享打印机,请添加一个位置,以便其他人可以看到打印机所在的位置。
它成功安装了打印机。根据需要将其设置为默认值或不设置。与往常一样,打印测试页(Print a test page)是个好主意。选择完成(Finish )关闭窗口。
通过 PowerShell 连接到网络打印机(Connect to a Network Printer via PowerShell)
最后,连接网络打印机的最后一种可能也是最好的方法是使用PowerShell。为什么这是最好的?如果您是系统管理员(System Administrator)并且有数十台打印机要连接,或者您需要确保每次服务器启动或有人登录时都连接打印机,那么最好使用PowerShell脚本。它速度快,一次完成,并且易于多次调用。
你需要知道:
- 打印机IP 地址
- 打印机驱动程序(Printer driver)名称
- 给打印机起什么名字
以下是一个示例脚本。将其制成循环脚本以一次安装多台打印机,或使其成为从其他进程调用的函数。
# 检查打印机端口是否存在
$portName = “TCPPort:192.168.8.101”
$portExist = Get-Printerport -Name $portName -ErrorAction SilentlyContinue
# 如果端口不存在,添加它
if (-not $portExists) {
Add-PrinterPort -name $portName -PrinterHostAddress “(-PrinterHostAddress) 192.168.8.101”
}
# 检查打印驱动程序
$driverName = “兄弟 MFC-7440N”
$driverExists = Get-PrinterDriver -name $driverName -ErrorAction SilentlyContinue
# 如果驱动程序存在则添加打印机,否则抛出错误
if ($driverExists) {
Add-Printer -Name “My Brother Printer” -PortName $portName -DriverName $driverName
} else {
写警告“未安装驱动程序(Driver)” -ForegroundColor Red
}
脚本运行时,可能需要 3 秒。然后你会看到打印机安装好了。
还有其他连接网络打印机的方法吗?(Any Other Ways to Connect to a Network Printer?)
我们为您提供了几种连接网络打印机或多台打印机的方法。其中之一将是您的最佳方式。至少还有另一种方式,那就是命令提示符(Command Prompt)。
它可以工作,但是当PowerShell更简单、更快时,为什么还要搞砸呢?我们可以使用组策略对象(Group Policy Object)部署打印机。不过,这超出了本文的范围。请在留言中让我们知道你的想法。我们帮你 了吗?(Did)
How to Connect to a Network Printer in Windows
Times change and so does Windows. If you’ve recently moved from a Windows Server 2012 and Windows 7 or 8 environments into Windows Server 2019 and Windows 10, things are a little different.
The old ways to connect to a network printer are still there. They may look a little different, too. So we’ll show you how to connect to a network printer in Windows 10 or Server 2019. Our favorite way is the last method.
Use Add Printers & Scanners
The new Windows Settings world works the same as in the Control Panel, but it looks different enough to cause confusion for some. Note that if this is at work and you’re not an administrator, the printer must be on the network and the driver already installed. If it’s not installed, you’ll get a prompt to enter the administrator account name and password.
- In the Start menu, type add printers. When the result Add a printer or scanner shows, select it.
- When the Printers & scanners window opens, select Add a printer or scanner. It will start searching for available printers.
- It may look like it’s still searching, even though all the printers available are showing. Find the printer needed, select it, and then the Add device button will show. Select it.
- The printer will install. There’ll be a progress bar and when it’s done, it’ll say Ready.
Connect to a Network Printer Through a Network Share
Here’s a way to install a printer that’s different from what you may be used to. It requires that the printer is shared and on the network. Unless you’re the administrator, the driver needs to be installed on your local machine or server. You need to know the path to the share as well. It will look something like \\Print-Server-Name, where Print-Server-name is the name of the server.
- Open File Explorer. In the location bar, enter the printer share path and then press the enter key. File Explorer will find the share.
All the shared printers will show.
- There are two options:
- Install a single printer
- Install several printers at one time
To install a single printer, double-click on it.
When the installation finishes, you’ll see the newly installed printer’s print queue window.
- To install several printers at once, select printers by clicking and dragging a rectangle around them, or hold down the Ctrl key while selecting printers individually. Either right-click and select Open or simply press the Enter key.
Connect to Network Printer via Control Panel
The good old control panel is still there. If you’ve used it before, you know what to do. If not, it’s almost the same as adding a printer through Settings.
- Open the Start menu and select Control Panel. If it’s not there, start typing control and it will show.
- Select Add a device in the Hardware category.
- Select Add a printer.
- It will show a selection of printers. Select the one needed and then select Next.
The printer will start installing. It may take a few seconds or minutes.
- Once the success window opens, there are options to Set as the default printer and Print a test page. Set the printer as default if needed. It’s always a good idea to print a test page. To exit, select Finish.
Connect to Network Printer via IP Address
The printer you want to install might not be easily visible, but if you have the IP address for it you can use that to connect with the printer. Administrator rights may be required. The first part is the same as adding a printer through the Control Panel until you get to the step to choose the printer. Let’s pick it up from there.
- At the Add a device window, select The printer that I want isn’t listed.
- If administrator rights are required, select Add a local or network printer as an administrator.
Otherwise, the window below will show. Select Add a printer using TCP/IP address or hostname then select Next.
- For Device type: there are several choices. Web Services Device and Web Services Secure Print Device are used for special cases. If you don’t know what those mean, you probably don’t need them. Autodetect may make the wrong choice as well. Select TCP/IP Device.
Enter the IP address in the Hostname or IP address: field. Notice how the Port name: field auto-populates with whatever is entered. The port name can be left as is or changed. In most cases, Query the printer and automatically select the driver to use remains checked.
Sometimes an organization will use a universal printer driver to keep things simpler and use less storage. It also keeps the registry small and login times faster. The HP Universal Print Driver works well for HP and many other printers. Select Next.
It detects the TCP/IP port to see if it exists.
Then it detects the driver model needed.
- Normally, Windows will find a driver already installed, offer the option to replace the driver, or ask to install a driver. If it’s on the network already, it probably installed the driver already. Select Use the driver that is currently installed and select Next.
- It will auto-select a name for the printer. That can change as needed. Select Next.
The real installation begins.
- If sharing the printer, add a location so others can see where the printer is located.
It successfully installed the printer. Set it as the default or not as needed. As always, it’s a good idea to Print a test page. Select Finish closes out the window.
Connect to a Network Printer via PowerShell
Finally, the last, and possibly best, way to connect network printers is with PowerShell. Why is this best? If you’re a System Administrator and have dozens of printers to connect, or if you need to make sure the printer is connected every time the server starts or someone logs in, a PowerShell script is best. It’s fast, done once, and easy to call many times.
You will need to know:
Following is a sample script. Make it into a looping script to install several printers at a time, or make it a function to call from other processes.
# check if a printer port exists
$portName = “TCPPort:192.168.8.101”
$portExist = Get-Printerport -Name $portName -ErrorAction SilentlyContinue
# if port doesn’t exist, add it
if (-not $portExists) {
Add-PrinterPort -name $portName -PrinterHostAddress “192.168.8.101”
}
# check for print driver
$driverName = “Brother MFC-7440N”
$driverExists = Get-PrinterDriver -name $driverName -ErrorAction SilentlyContinue
# add printer if driver exists or else throw an error
if ($driverExists) {
Add-Printer -Name “My Brother Printer” -PortName $portName -DriverName $driverName
} else {
Write-Warning “Driver not installed” -ForegroundColor Red
}
When the script is run, it takes maybe 3 seconds. Then you’ll see the printer installed.
Any Other Ways to Connect to a Network Printer?
We’ve given you several ways to connect to a network printer or several printers. One of them will be the best way for you. There is at least one other way, and that’s by the Command Prompt.
It works, but why mess with that when PowerShell is simpler and faster? We can deploy printers using a Group Policy Object. That’s beyond this article, though. Let us know what you think in the comments. Did we help you?