Jump to content

Installing Printers on Multiple units remotely?


lennyd33

Recommended Posts

I know it can be done..... just cant find a working solution.....

Esentially on a windows based network, I would like a way to install a ip network printer to a number of workstations with printer config as well ( trays, multfeeder, duplexing)

anyone have a working solution - im a scripting noob

Link to comment
Share on other sites


Do you have access to an active directory?

If so the way i did was by creating a group called 2nd floor printers

and added the users to this group.

then i wrote a login script (push with a group policy under user config)

the script look something like this

On Error Resume Next

Dim WshNetwork, WshShell

Set objNetwork = CreateObject("Wscript.Network")

strUser = objNetwork.UserName

Set WshNetwork = WScript.CreateObject("WScript.Network")

Set objFSO = CreateObject("Scripting.FileSystemObject")

fComputername = WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")

if isMember("2nd Floor Printers")then

'******this creates a file so it won't reinstall the printers on next log on*************

If objFSO.FileExists("C:\Documents and Settings\" & strUser & "\My Documents\2ndFloorPrinters.tst") then

Set objFolder = objFSO.GetFile("C:\Documents and Settings\" & strUser & "\My Documents\2ndFloorPrinters.tst")

Else

objFSO.CopyFile "\\server001\PrintersScripts\2ndFloorPrinters.tst" , "C:\Documents and Settings\" & strUser & "\My Documents\", OverwriteExisting

'*****This deletes all network printers already installed***************************

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _

("Select * from Win32_Printer Where Network = TRUE")

For Each objPrinter in colInstalledPrinters

objPrinter.Delete_

Next

AddPrinter "\\server001\printer001"

AddPrinter "\\server001\printer002"

End if

End if

Let me know if this help

Link to comment
Share on other sites

@Lennyd33,

I do have AD, but only one printer, (one floor space of html coders, not much printing) but it has A3 and a A4 tray (NZ paper sizes, not letter format), so here is my lazy way of not learning scripting :)

The following doesnt do the remote install per say, I use AD/login scripts to run the files below, as I also use the same script on the RIS install. Its not flash, but it does the job.

I use a post install script of

start /wait wscript %systemdrive%\install\setprint.vbs
regedit /s %systemdrive%\install\photocopier-on-prak-dc01.reg

The Setprint.vbs is

'// Name: setprint.vbs
'// Description: Add a network printer and make it the default

Set WshNetwork = CreateObject("WScript.Network")

'// Adds the printer. Substitute your server name and printer share.
WshNetwork.AddwindowsPrinterConnection "\\prak-dc01\photocopier-a3"
WshNetwork.AddwindowsPrinterConnection "\\prak-dc01\photocopier-a4"

'// Makes the specified printer the default.
WshNetwork.SetDefaultPrinter "\\prak-dc01\photocopier-a4"

The Photocopier-on-PRAK-DC01.reg

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Printers\Connections]

[HKEY_CURRENT_USER\Printers\Connections\,,prak-dc01,Photocopier-A3]
"Server"="\\\\prak-dc01"
"Provider"="win32spl.dll"
"DevMode"=hex:5c,00,5c,00,70,00,72,00,61,00,6b,00,2d,00,64,00,63,00,30,00,31,\
00,5c,00,50,00,68,00,6f,00,74,00,6f,00,63,00,6f,00,70,00,69,00,65,00,72,00,\
2d,00,41,00,33,00,00,00,4c,00,20,00,36,00,00,00,00,00,01,04,28,01,dc,00,6c,\
... lots of lines of hex deleted for readabilty

[HKEY_CURRENT_USER\Printers\Connections\,,prak-dc01,Photocopier-A4]
"Server"="\\\\prak-dc01"
"Provider"="win32spl.dll"
"DevMode"=hex:5c,00,5c,00,70,00,72,00,61,00,6b,00,2d,00,64,00,63,00,30,00,31,\
00,5c,00,50,00,68,00,6f,00,74,00,6f,00,63,00,6f,00,70,00,69,00,65,00,72,00,\
2d,00,41,00,34,00,00,00,4c,00,20,00,36,00,00,00,00,00,01,04,28,01,dc,00,6c,\
04,03,4f,00,00,01,00,09,00,b3,0d,b0,09,64,00,01,00,01,00,58,02,01,00,01,00,\
... lots of lines of hex deleted for readabilty

To get the code above for the reg import, setup the printer on a test/your machine, set the paper trays if required, then export the HKCU\Prineters\Connections .

In my situation, I create a Printer entry per paper type, so when the luser (not a typo) goes file/print, they only have to select this printer for this paper size or that printer for that paper size, even though its printed on the same physical printer, just different paper sizes.

Saves the luser asking all the stupid questions that one gets :yes:

Edited by Vits
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...