Using A Script To Install Printers Remotely

I've been trying to install a network printer using Powershell on Windows 7 so that I can automate the setup of our development machines using Puppet. I found a couple of instructions around but n. Jul 03, 2018  Add-printer remotely. Author: Posts Windows LiveUser103. Topics: 3 Replies: 4. 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. If I want to use. I am unable to run an invoke-command script to install printers on a remote machine. My code works locally, but as soon as I pipe it into Invoke-command, i get errors. Need a script to remotely install printer drivers. All, I have a folder with printer drivers on a server, I need to install drivers remotely is there a script to do that?

Add Printer Remotely

Active2 years, 5 months ago

I am unable to run an invoke-command script to install printers on a remote machine. My code works locally, but as soon as I pipe it into Invoke-command, i get errors.

Local:

And this adds the printer just fine. I can do this same command on the remote computer with no issues. But when i tried to execute the command remotely I have the issues.

Remote:

Which returns the error 'The printer name is invalid'

So I tried to see what the shell was sending to the remote computer with the following code, and everything in the write output looks good, but I still get errors:

Output:

So I've tried Paul's code with a number of different entries to the argumentlist. All have not worked so far. i think the first 3 are closer to an answer.

Results in:

Result in:

user3351863
user3351863user3351863

2 Answers

Try this:

I think it´s because your $printer variable is placed between single quotes, variables between single quotes are not interpreted by powershell. So the printername your function probably gets is '$printer'.

Software

In case you wonder it is printed out correctly in your write-host statement because here the single quotes are inside a string.

The versatile TM-U220 suits a large vary of wants and applications. Free download epson m188d printer driver.

PaulPaul
4,1371 gold badge15 silver badges33 bronze badges

Using A Script To Install Printers Remotely Access

you need to use $Using:yourvar to pass variables to the scriptblock

David CDavid C

Using A Script To Install Printers Remotely Meaning

Not the answer you're looking for? Browse other questions tagged powershellprinting or ask your own question.