Printers via GPO scripts?

G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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
--
Regards
Christoffer Andersson

No email replies please - reply in the newsgroup
------------------------------------------------
http://www.chrisse.se - Active Directory Tips

"Tim Guy" <tim@hurtwood.demon.co.uk> skrev i meddelandet
news:eg0siwKKEHA.3924@tk2msftngp13.phx.gbl...
> 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
>
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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


"Chriss3" <noSpamHere@chrisse.se> wrote in message
news:#RUxd$KKEHA.3944@tk2msftngp13.phx.gbl...
> 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.msp
x
> --
> Regards
> Christoffer Andersson
>
> No email replies please - reply in the newsgroup
> ------------------------------------------------
> http://www.chrisse.se - Active Directory Tips
>
> "Tim Guy" <tim@hurtwood.demon.co.uk> skrev i meddelandet
> news:eg0siwKKEHA.3924@tk2msftngp13.phx.gbl...
> > 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
> >
> >
> >
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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
desmondb@payton.cps.k12.il.us

Http://www.briandesmond.com


"Tim Guy" <tim@hurtwood.demon.co.uk> wrote in message
news:%23ckm8BLKEHA.2380@TK2MSFTNGP09.phx.gbl...
> 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
>
>
> "Chriss3" <noSpamHere@chrisse.se> wrote in message
> news:#RUxd$KKEHA.3944@tk2msftngp13.phx.gbl...
> > 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.msp
> x
> > --
> > Regards
> > Christoffer Andersson
> >
> > No email replies please - reply in the newsgroup
> > ------------------------------------------------
> > http://www.chrisse.se - Active Directory Tips
> >
> > "Tim Guy" <tim@hurtwood.demon.co.uk> skrev i meddelandet
> > news:eg0siwKKEHA.3924@tk2msftngp13.phx.gbl...
> > > 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
> > >
> > >
> > >
> >
> >
>
>
 

Rich

Distinguished
Mar 31, 2004
943
0
18,980
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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

>-----Original Message-----
>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/pr
inting/default.mspx
>--
>Regards
>Christoffer Andersson
>
>No email replies please - reply in the newsgroup
>------------------------------------------------
>http://www.chrisse.se - Active Directory Tips
>
>"Tim Guy" <tim@hurtwood.demon.co.uk> skrev i meddelandet
>news:eg0siwKKEHA.3924@tk2msftngp13.phx.gbl...
>> 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
>>
>>
>>
>
>
>.
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

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

----------------------------------------------------------

Brian Desmond [MVP] wrote:
> *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
> desmondb@payton.cps.k12.il.us
>
> Http://www.briandesmond.com
>
>
> "Tim Guy" <tim@hurtwood.demon.co.uk> wrote in message
> news:%23ckm8BLKEHA.2380@TK2MSFTNGP09.phx.gbl...
> > 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
> >
> >
> > "Chriss3" <noSpamHere@chrisse.se> wrote in message
> > news:#RUxd$KKEHA.3944@tk2msftngp13.phx.gbl...
> > instead.
> "\root\cimv2")[vbcol=seagreen]
> >
> http://tinyurl.com/yrqtc
> > x
> so[vbcol=seagreen]
> when[vbcol=seagreen]
> > share
> > the
> > the
> >
> > *



--
Weatherman
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message597337.html