PC Review


Reply
Thread Tools Rate Thread

Assign Printers to computers via GPO startup via vb script

 
 
=?Utf-8?B?SWdvcnMgQmVsaWpz?=
Guest
Posts: n/a
 
      2nd Nov 2006
Good day to you all!
Could not find the answer in previous posts, therefore I'm posting a new
topic.

I'm running Windows 2000 domain in native mode, under 2000 SP4 Standart.

The task is to automate shared network printers installation.
I have created GPO, that will run VB script on startup and map those printers.

Here's the script:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\server\HPLaserJet_nd"
objNetwork.AddWindowsPrinterConnection "\\server\DuPrinter"
objNetwork.AddWindowsPrinterConnection "\\server\HPLJ@Hallway"
objNetwork.SetDefaultPrinter "\\server\HPLaserJet_nd"
WScript.Quit

Now for some reason the script does not run when applied to computer, and no
mapping occur. On other hand if the same script is applied to user, script
works fine.

Permission on the shared printer is set to Everyone = Print.

What can be done to resolve this situation?
 
Reply With Quote
 
 
 
 
Alan Morris [MSFT]
Guest
Posts: n/a
 
      2nd Nov 2006
these are "user" connections written to the user registry. You need to use
rundll32. This can be performed remotely as well.

http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm

Add per machine printer connection (the connection will be propagated to
the user upon logon):
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer
/j"LanMan Print Services"
Delete per machine printer connection (the connection will be deleted
upon user logon):
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
Enumerate per machine printer connections:
rundll32 printui.dll,PrintUIEntry /ge /c\\machine


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

"Igors Belijs" <(E-Mail Removed)> wrote in message
news:96C6F93F-DBCF-4449-AF40-(E-Mail Removed)...
> Good day to you all!
> Could not find the answer in previous posts, therefore I'm posting a new
> topic.
>
> I'm running Windows 2000 domain in native mode, under 2000 SP4 Standart.
>
> The task is to automate shared network printers installation.
> I have created GPO, that will run VB script on startup and map those
> printers.
>
> Here's the script:
>
> Set objNetwork = CreateObject("WScript.Network")
> objNetwork.AddWindowsPrinterConnection "\\server\HPLaserJet_nd"
> objNetwork.AddWindowsPrinterConnection "\\server\DuPrinter"
> objNetwork.AddWindowsPrinterConnection "\\server\HPLJ@Hallway"
> objNetwork.SetDefaultPrinter "\\server\HPLaserJet_nd"
> WScript.Quit
>
> Now for some reason the script does not run when applied to computer, and
> no
> mapping occur. On other hand if the same script is applied to user, script
> works fine.
>
> Permission on the shared printer is set to Everyone = Print.
>
> What can be done to resolve this situation?



 
Reply With Quote
 
=?Utf-8?B?SWdvcnMgQmVsaWpz?=
Guest
Posts: n/a
 
      2nd Nov 2006
Thanks a lot!
That is very helpful info

"Alan Morris [MSFT]" wrote:

> these are "user" connections written to the user registry. You need to use
> rundll32. This can be performed remotely as well.
>
> http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm
>
> Add per machine printer connection (the connection will be propagated to
> the user upon logon):
> rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer
> /j"LanMan Print Services"
> Delete per machine printer connection (the connection will be deleted
> upon user logon):
> rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
> Enumerate per machine printer connections:
> rundll32 printui.dll,PrintUIEntry /ge /c\\machine
>
>
> --
> Alan Morris
> Windows Printing Team
> Search the Microsoft Knowledge Base here:
> http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Igors Belijs" <(E-Mail Removed)> wrote in message
> news:96C6F93F-DBCF-4449-AF40-(E-Mail Removed)...
> > Good day to you all!
> > Could not find the answer in previous posts, therefore I'm posting a new
> > topic.
> >
> > I'm running Windows 2000 domain in native mode, under 2000 SP4 Standart.
> >
> > The task is to automate shared network printers installation.
> > I have created GPO, that will run VB script on startup and map those
> > printers.
> >
> > Here's the script:
> >
> > Set objNetwork = CreateObject("WScript.Network")
> > objNetwork.AddWindowsPrinterConnection "\\server\HPLaserJet_nd"
> > objNetwork.AddWindowsPrinterConnection "\\server\DuPrinter"
> > objNetwork.AddWindowsPrinterConnection "\\server\HPLJ@Hallway"
> > objNetwork.SetDefaultPrinter "\\server\HPLaserJet_nd"
> > WScript.Quit
> >
> > Now for some reason the script does not run when applied to computer, and
> > no
> > mapping occur. On other hand if the same script is applied to user, script
> > works fine.
> >
> > Permission on the shared printer is set to Everyone = Print.
> >
> > What can be done to resolve this situation?

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Network Printers using a "Startup" script. Chris Dersham Microsoft Windows 2000 Group Policy 4 6th Sep 2005 11:20 AM
Adding Network Printers using a "Startup" script Dragonfly Microsoft Windows 2000 Printing 1 12th Aug 2003 06:09 AM
Adding Network Printers using a "Startup" script. Dragonfly Microsoft Windows 2000 Active Directory 1 8th Aug 2003 07:30 PM
Assign printers to machines Davidp Microsoft Windows 2000 Group Policy 1 8th Aug 2003 03:51 PM
Assign printers by GPO? Bob Microsoft Windows 2000 1 27th Jul 2003 04:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 PM.