Avatar of jskfan
jskfan
Flag for Cyprus asked on

Migrate /Backup /Restore a printer from Source Computer to Destination Computer

Migrate /Backup /Restore a printer from Source Computer to Destination Computer

I would like to have a a printer installed on one computer and the same printer will be installed on other computers. There is no Print Server.

I found this link that talks about that:

https://www.robvanderwoude.com/printtools.php

it also has printer commands on this link:
https://www.robvanderwoude.com/2kprintcontrol.php


Thank you
Printers and ScannersWindows BatchWindows OSScripting Languages

Avatar of undefined
Last Comment
jskfan

8/22/2022 - Mon
arnold

Not sure I understand, though install on one, while sharing. Then add this shared printer on any new system, then change it to direct.

Deals with getting drivers from the system sharing the printer.
On the second, add a TCP/ip port with ip if the printer, and then bind the printer to the new TCP/ip port.

Which printer make?

Main issue is whether the printer in question has drivers included in Windows.
If it is an HP as an example whose drivers are included in the OS.

You could look at powershell, vbscript net use to create the printer by correctly pointing at the driver..
Dimitris Maleas

Hi,
If the printers are network printers use the scripts on this page
https://www.alexcomputerbubble.com/backup-and-restore-printers-with-powershell/
jskfan

ASKER
Printers Install  Scripts were not successful for me. I posted a bunch of questions about that, I did not get help
The Scripts will install printer on remote computer, but  it will not print..

I thought probably if you install local printer[TCP/IP Standard] then back it up to somewhere in the network, then from another computer restore  it , that might do the job.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
arnold

What you are talking requires the drivers for the printer to be locally available.
Much depends on the printer at hand.
In a non-domain environment, you have  to access each system any way, might as well do it right from the start.

Inevitably some may not work for ... And would require a secondary debug, .......
jskfan

ASKER
yes..
if I go to a computer and install the printer, the manufacturer and drivers are available in the Add printer Wizard..
arnold

The powershell example of migrating/transferring shoukd work.

The issues often arise are with the spoiler.

How many systems are we talking about?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
let's try it with one remote computer
arnold

Commonly it is used on server platform for transition

https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Script-for-057ae37a

Try the example dimitris provided.

The other to see is using wmi

Much in a non domain environment depends on the Windows firewall and whether it allows remote access.
jskfan

ASKER
I guess you misunderstood my question.

Let 's say I have local (TCP/IP standard) printer installed on PC1
the same printer needs to be installed on PC2,PC3.....PCn

I thought if I backup the printer that is installed on PC1, I can restore it to PC2,PC3.....PCn

is it possible ?

I found  this link :https://msfn.org/board/topic/26296-installing-network-printers-silently-heres-how/

it seems like this guy was able to get a printer installed on one PC and then  exported the registry he specified to a .reg file , and probable he deployed that .reg file along with the script to other PCs...

but the way he explained is a little bit not clear to me
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
arnold

that is exactly what it was, but as you note you have to have the paths to the INF file and the ....
c:\windows\system32\inf etc.

that is the issue when one is using powershell as well or net use to define a new printer...

The issue is that you are not in a domain environment, so not sure how you are thinking of pushing the printer ....
windows 10 has auto-dicovery, but the printer might have to be .....

In a situation such as yours, I commonly do what I had suggested after the printer is added and shared. I add the shared printer and then modify the references ......
That rundll32.... is an older printui.. reference.....
The powershell script is for servers, but it enumerates the printers/shares on the system where the script runs so that they can be imported/setup on the new server...

You could try whether it will list the printer on the base system and then see whether you can use the results to setup the printer on another system,..
jskfan

ASKER
I do not want you to worry about the computer is or is not in the Domain....We can make it member of the Domain..

can you do a test by installing an HP printer [with HP Universal Printing PCL 6 as a driver] on a remote computer with a Script ?
arnold

Universal means, you used hp's installer to setup the printer?
As noted, in a scenario such as yours, I use the course of action I suggested.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
if I am logged in to a computer locally I just run Add Printer Wizard and select the "HP Universal Printing PCL 6" as a driver...everything works fine.

I want an Expert to help me install the printer on a remote computer using a script or command line...or something like that....
I have seen many suggestions from many people but no one has tested it to make sure it worked...
arnold

Please try the powershell script posted that deals with helping an admin transfer shares and printers.
Run the powershell script to see what it shows.
Then try using the result to setup the printer on the new computer.

There similarly are vbscripts that do the same thing.
I do not believe the printer and devices control panel, or however the printer is presented provides a backup or restore option.

The various scripts deal with extracting the current config and commonly provide the commands that need to be run to get it added ...
jskfan

ASKER
I have used VBscript for printers included with windows OS.
I can add printer to remote computer but it does not print
I think the issue is with Registry...
I found this link: https://msfn.org/board/topic/26296-installing-network-printers-silently-heres-how/

but it is not clearly explained...
Can you read it and maybe you can come up with better conclusion ?

Thank you
Your help has saved me hundreds of hours of internet surfing.
fblack61
arnold

You are using/referencing an older rundll/printui interface.

Which vbscript are you using? Ties into wmi, or using psexec?

Please consider looking at a more modern approach to printer addition...
jskfan

ASKER
if you check in this path below, on your windows computer, you will find a bunch of Printing Scripts that comes with the Operating system:
C:\Windows\System32\Printing_Admin_Scripts\en-US


I have used: PrnPort.vbs , Prndrvr, Prnmngr
I was able to get the Printer Installed on Remote Computer, but unable to Print from it...
On the Local computer, for instance if I install the printer via the Scripts, it will install properly and I can print...This might tell you something

**If you have 2 computers, please try to install a Standard TCP/IP printer with driver "HP Universal Printing PCL 6"  , and paste  the Code here, so that I can try it .... Whatever approach works for you will be fine
Thank you
arnold

When you can not print, where is the error. In the spool pending or it errors in the print i.e. get error about the printing system?

Is the spool service running past install.

While you are adding tcp/ip properties of the printer, is it bound to this port?

The steps/commands are one thing, the resulting config might have a small variation as simple as the printer instead of being attached to a tcp/ip it is bound to something else resulting in the job being stuck in the spool.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
here is the error.. when I try to check the properties of the printer on a remote computer after the Script installs the printer
p
I tried several scripts , one of them is here:
for /f %%a in (C:\Scripts\CalledScripts\CompOnly.CSV) do (


@echo Creating Printer Port on %%a
 cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a  -s %%a -r "Printerhostname" -h hostname -o raw -n 9100


cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\Prndrvr.vbs" -a   -m "HP Universal Printing PCL 6"  -h "sccm\hp drivers\hpcu230u.inf" -s %%a



@echo Setting Printer on %%a
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -a -p "Printer Queue Name" -m "HP Universal Printing PCL 6" -r "Printerhostname" -s %%a




)

Open in new window

arnold

The error seems to point to your "Printer Queue Name" designation as the issue.

The queue name ........ Of the installed printer......
jskfan

ASKER
have you tried to install a printer on a remote computer using a Script ?
If you have 2 Networked computers either physical or virtual, please try it and let me know if you were successful..
Thank you
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
arnold

As I noted in my suggestion, the scope of the need did not require the extensive process. Used the script I posted that dealt with migrating printers/shares from servers.
In most cases I am in an AD environment and use printer server and GPO to push printers.

So the direct answer is no.
arnold

With that said, the error you get is not the printer did not install, the issue is that it tied to a queue that does not exist.
jskfan

ASKER

With that said, the error you get is not the printer did not install, the issue is that it tied to a queue that does not exist.

Of Course the Queue should not exist before you create it...
I see You are thinking Print Server , where the Print Queue already exists on the server...
This is a different case scenario....I am not sure if I am clear in my Question... I believe it is simple:

Current Manual Printer Install:
  -- Go to each Computer, run the Add Printer Wizard, Select Local Printer, TCP/IP Standard,  Provide the Hostname of the printer, Select HP as Manufacturer , "HP Universal Printing PCL 6"  as a driver... Next ...Next.... and it will install the local Printer.

Goal:
How to Automate Current Manual Print Install
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
arnold

you need to use the prnqctl.vbs

In your example you run printer setup, prnmngr.vbs before you created the queue while setting a queue that does not exist.

Here is a writeup of the tools you are using.

https://www.techrepublic.com/blog/windows-and-office/discover-the-power-of-windows-7-hidden-vbscript-print-utilities/
arnold

missed you are not defining the queue.
-q "QueueName" you have -p "Printer Queue Name"

Try the following instead in your script                                                                              v
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -d -a -q "Printer Queue Name" -m "HP Universal Printing PCL 6" -r "Printerhostname" -s %%a
jskfan

ASKER
are you sure there is -q switch...?
it is not recognized ...
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
arnold

prnports.vbs is where the queue can be defined, optional.
Relied on the data I. The quotes.

Your prnmngr.vbs identifies the printer -p as "Printer Queue Name"
-p is supposed to identify the printer being added...
jskfan

ASKER
ok you meant Prnport.vbs
arnold

You should recheck the scripting command you are using and their options.
Yes.


You are running through a loop of perhaps multiple printers to be added, though PortName, printer name use static names.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
Thanks Arnold..
The error on the screenshot previously pasted does not show on certain computers now... it shows only on one computer...

I will test that at work and see...

Thanks for your Help