Printers via GPO scripts?

  • Thread starter Thread starter Tim Guy
  • Start date Start date
T

Tim Guy

So Im getting clever now and want to drop machines into location GPOs so
that users load a network printer from a Windows 2003 Print server when the
logon

Im assuming I can use the rundll32 printui.dll,PrintUIEntry command??

Can someone give me the correct command for connecting to a network share
printer to download the driver (as if I was clicking on a printer via the
gui network neighourhood?), there are loads of options when I look at the
help command and Im getting confused.

If I am using roaming profiles, will that printer stay with the user unless
I run a log off script to delete it?

Cheers

Tim
 
I recommend you to use the follow script for TechNet Script center instead.
Assign this scripts as an logon script within a GPO.

322241 - HOW TO: Assign Scripts in Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;EN-US;32224

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "HP LaserJet 4000 Series PS"
objPrinter.PortName = "IP_169.254.110.160"
objPrinter.DeviceID = "ScriptedPrinter"
objPrinter.Location = "USA/Redmond/Building 37/Room 114"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "ScriptedPrinter"
objPrinter.Put_

For more scipting aginst printers see the link below.
http://www.microsoft.com/technet/community/scriptcenter/printing/default.mspx
 
Im not scripting genius to be honest Chirs. In fact Im still a keen "net
use" type person.

I have found that:

rundll32 printui.dll,PrintUIEntry /in /n \\server\printer

Works well. What are the disadvanges of using this over your suggestion?

Cheers

Tim
 
Tim,

Removing printers installed that way is a bit more difficult than simply
removing the line of code from the logon script. You also have to restart
the spooler service for the rundll32 trick to work.

--
--
Brian Desmond
Windows Server MVP
(e-mail address removed)12.il.us

Http://www.briandesmond.com
 
Doesn't you example add a logical printer to a print
server? This would install on every client the printers
locally and then share them.

How do you script the printer installation from the
printer server to the client?

Rich
 
E.g c:\script.cmd MyPc PrintServer\Printer

rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2
ga - will add printer
gd - will delete that printer
start /wait sc \\%1 stop spooler
start /wait sc \\%1 start spooler

For more infomation... goto:
http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm

----------------------------------------------------------
*Tim,

Removing printers installed that way is a bit more difficult tha
simply
removing the line of code from the logon script. You also have t
restart
the spooler service for the rundll32 trick to work.

--
--
Brian Desmond
Windows Server MVP
(e-mail address removed)12.il.us

Http://www.briandesmond.com


Tim Guy said:
Im not scripting genius to be honest Chirs. In fact Im still a kee "net
use" type person.

I have found that:

rundll32 printui.dll,PrintUIEntry /in /n \\server\printer

Works well. What are the disadvanges of using this over you suggestion?

Cheers

Tim


instead. "\root\cimv2")[vbcol=seagreen]http://tinyurl.com/yrqtc
so[vbcol=seagreen]
when[vbcol=seagreen]
share
the
the


-
Weatherma
 
Back
Top