# Add-printer remotely

**URL:** <https://forums.powershell.org/t/add-printer-remotely/4599>\
**Category:** PowerShell Help\
**Created:** [July 30, 2015, 5:34am UTC](https://forums.powershell.org/t/add-printer-remotely/4599 "2015-07-30T05:34:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![windows-liveuser103](https://avatars.discourse-cdn.com/v4/letter/w/dc4da7/32.png) [@windows-liveuser103](https://forums.powershell.org/u/windows-liveuser103)\
**Post date:** [July 30, 2015, 5:34am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/1 "2015-07-30T05:34:39Z")

</div>

I am trying to run this command remotely through invoke-command and pssessions, but it does not work. Locally I am able to add-printer and remove-printer, but the exact same commands don’t work remotely. I get an error that the printer server or name may be incorrect. Any ideas?

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [July 30, 2015, 5:45am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/2 "2015-07-30T05:45:13Z")

</div>

Two possibilities.

One, when you remote into a machine, you don’t spin up a full user profile. It’s more like connecting to a network share. So it could be running into a problem if it’s expecting a user profile.

Second, when your credentials are delegated to the remote machine, it can only use them for local resources. If it needs to connect to a print server, then it’s likely failing if the print server won’t accept an anonymous connection. This is called the “second hop” problem, and it’s discussed at some length in “Secrets of PowerShell Remoting” (free from the Resources/eBooks menu here), along with workarounds.

---

<div class="post-metadata">

**Author:** ![greg-altman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/greg-altman/32/665_2.png) [@greg-altman](https://forums.powershell.org/u/greg-altman)\
**Post date:** [July 30, 2015, 5:55am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/3 "2015-07-30T05:55:13Z")

</div>

Depending on the version of PowerShell, I have had success with

```
#Add Ports
    Add-PrinterPort -Name $PrinterPort -PrinterHostAddress $PrinterIP -ComputerName $Computer   
# Add Printers
    Add-Printer -computername $Computer -name $PrinterName -PortName $PrinterName-DriverName "HP Universal Printing PCL 6"
```

That assumes the driver is on the client PC already.

Also note this is NOT run thru a PSSession or Invoke-Command. The Add-Printer and Add-Printerport have a -computername parameter.

---

<div class="post-metadata">

**Author:** ![windows-liveuser103](https://avatars.discourse-cdn.com/v4/letter/w/dc4da7/32.png) [@windows-liveuser103](https://forums.powershell.org/u/windows-liveuser103)\
**Post date:** [July 30, 2015, 6:14am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/4 "2015-07-30T06:14:12Z")

</div>

That worked!

---

<div class="post-metadata">

**Author:** ![windows-liveuser103](https://avatars.discourse-cdn.com/v4/letter/w/dc4da7/32.png) [@windows-liveuser103](https://forums.powershell.org/u/windows-liveuser103)\
**Post date:** [July 30, 2015, 7:25am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/5 "2015-07-30T07:25:29Z")

</div>

Greg,

These commands work I am able to remotely add and remove printers. If I want to use this to add printers to multiple computer at once the variable doesn’t work. Example $computer = user1,user2. This gives me a failure.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [July 30, 2015, 7:32am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/6 "2015-07-30T07:32:36Z")

</div>

The -ComputerName parameter of Add-Printer only accepts a single computer name.

As in the help file:

**-ComputerName String**

Not:

**-ComputerName String**

---

<div class="post-metadata">

**Author:** ![windows-liveuser103](https://avatars.discourse-cdn.com/v4/letter/w/dc4da7/32.png) [@windows-liveuser103](https://forums.powershell.org/u/windows-liveuser103)\
**Post date:** [July 30, 2015, 7:36am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/7 "2015-07-30T07:36:07Z")

</div>

Thank you Don.

---

<div class="post-metadata">

**Author:** ![greg-altman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/greg-altman/32/665_2.png) [@greg-altman](https://forums.powershell.org/u/greg-altman)\
**Post date:** [July 30, 2015, 9:11am UTC](https://forums.powershell.org/t/add-printer-remotely/4599/8 "2015-07-30T09:11:03Z")

</div>

yep, the quick and easy way is :

```
$Computers = 'PC1','PC2','PC3'
ForEach ($Computer in $Computers) {
        #Add Ports
       Add-PrinterPort -Name $PrinterPort -PrinterHostAddress $PrinterIP -ComputerName $Computer   
       # Add Printers
       Add-Printer -computername $Computer -name $PrinterName -PortName $PrinterName-DriverName "HP Universal Printing PCL 6"
}
```

---

<div class="post-metadata">

**Author:** ![macattack003](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@macattack003](https://forums.powershell.org/u/macattack003)\
**Post date:** [September 11, 2017, 3:46pm UTC](https://forums.powershell.org/t/add-printer-remotely/4599/9 "2017-09-11T15:46:33Z")

</div>

Is there a way to reference a specific share with printer drivers located in it for the printer rather than using the ones from the machine?

---

<div class="post-metadata">

**Author:** ![jb-lewis](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jb-lewis](https://forums.powershell.org/u/jb-lewis)\
**Post date:** [September 12, 2017, 5:53pm UTC](https://forums.powershell.org/t/add-printer-remotely/4599/10 "2017-09-12T17:53:27Z")

</div>

I believe you’d then be looking at Add-PrinterDriver, you can provide a path to an INF file. Unfortunately, the help for Add-PrinterDriver is somewhat lacking. You need to install the print(er) driver, before you can add a printer that uses that driver.

JBLewis

---

<div class="post-metadata">

**Author:** ![tannaldietrich](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tannaldietrich](https://forums.powershell.org/u/tannaldietrich)\
**Post date:** [July 3, 2018, 1:57pm UTC](https://forums.powershell.org/t/add-printer-remotely/4599/11 "2018-07-03T13:57:37Z")

</div>

Printer server is working with a client and it is work is very fast but sometimes It shows error as printer server name is incorrect. It usually shows when a server is down. A solution to this problem is that printer driver is reinstalling with the correct name. [Ricoh printer support](https://printerssupport.org/ricoh-printer-support/) provides you printer server repair service

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/add-printer-remotely/4599/12 "2024-05-16T20:34:45Z")

</div>

Closed on May 16, 2024, 8:34pm UTC


