+ Post New Thread
Results 1 to 10 of 10
Scripts Thread, Deploying Printers via VBS script issues in Coding and Web Development; All Trying to deploy printers via group policy. Background: 2003 R2 with all printers installed and shared, clients XP SP3 ...
  1. #1

    Join Date
    Jun 2010
    Posts
    8
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Deploying Printers via VBS script issues

    All

    Trying to deploy printers via group policy.

    Background: 2003 R2 with all printers installed and shared, clients XP SP3

    I've tried using pushprinterconnections.exe with 2003 R2 Printer console but the results are far from consistent (sometimes it took two reboots to add all printers, sometimes it just didn't add them), so I thought I'd switch to a simple .vbs script: Add a Printer Connection

    This gives a similar experience. If I have two GPOs each with a single printer, it takes two logins for them both to be added.

    Any ideas?

    The XP machines don't have CSE installed yet, so I can't use GPP.

    Ignore the attached image, I seem to have resolved that.
    Attached Images Attached Images
    Last edited by tom84; 8th August 2011 at 04:54 PM.

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,731
    Thank Post
    344
    Thanked 520 Times in 488 Posts
    Rep Power
    180
    Can you post full script what you're using, no reason it shouldn't be working. We're using same design as the above site. (May just be a typo in your script)

    Steve

  3. #3

    Join Date
    Jun 2010
    Posts
    8
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Sure:

    Set WshNetwork = CreateObject("WScript.Network")
    WshNetwork.AddWindowsPrinterConnection "\\dc1\3rd Floor - 1 DUPLEX"

    I've creating a separate GPO per printer, and I'm testing in an OU with two GPOs applied at the moment.

    I can consistently replicate this by removing both printers + driver. First logon installs 1 of the printers, 2nd logon installs the next and I seem to be getting this regardless of deployment method (pushprinterconnections.exe or .vbs).

  4. #4

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,731
    Thank Post
    344
    Thanked 520 Times in 488 Posts
    Rep Power
    180
    And you've got both 64bit "and" 32 bit drivers deployed on your server?

    Steve

  5. #5

    Join Date
    Jun 2010
    Posts
    8
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Just the 32bit drivers, as both server and client OS are 32bit.

  6. #6

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,731
    Thank Post
    344
    Thanked 520 Times in 488 Posts
    Rep Power
    180
    Quote Originally Posted by tom84 View Post
    . First logon installs 1 of the printers, 2nd logon installs the next and I seem to be getting this regardless of deployment method (pushprinterconnections.exe or .vbs).
    When you say that, Do you mean the first printer installs fine, then it errors on 2nd logon?

    Steve

  7. #7

    Join Date
    Jun 2010
    Posts
    8
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I'll rephrase!

    It only seems to install 1 printer per login, and it isn't always the same printer out of the 2 applied via GPO.

    E.G

    Sometimes it'll connect Printer1 on 1st logon, then if I logoff/logon it'll connect to Printer2.

    Sometimes it'll connect Printer2 on 1st logon, then if iI logoff/logon it'll connect to Printer1.

    I don't see any errors or reasons as to why.

  8. #8

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,731
    Thank Post
    344
    Thanked 520 Times in 488 Posts
    Rep Power
    180
    Can you try installing it this way:

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run "RunDLL32 <\\server\share\drvsrv,Install> "<\\server\share>", 1, True

    Some ways on older setups it'll complain if you're adding two printers using same driver, as it bases their name on the printer driver name.

    Steve

  9. Thanks to Steve21 from:

    tom84 (8th August 2011)

  10. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,924
    Thank Post
    3,456
    Thanked 1,089 Times in 1,004 Posts
    Rep Power
    371
    Don't you need the snippet of code that removes all printers first before adding them ??

    Haven't got my coding hat on at the min heh

    Also if you use the ip address of the DC or server and use shorter share names that are one word ?

  11. #10

    Join Date
    Jun 2010
    Posts
    8
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Steve, you've picked up on a good point.

    I've decided to deploy both printers via one .VBS with the original code I posted- which works great.

    Having thought about it further, I don't need to get that granular with group policy. If they need one they'll want the other (basically one is single sided and one is duplex).

    mac_shinobi, let me know if you remember anymore

    Thanks for your efforts.



SHARE:
+ Post New Thread

Similar Threads

  1. BGInfo via VBS startup script?
    By gshaw in forum Windows
    Replies: 19
    Last Post: 18th July 2012, 03:51 AM
  2. Printers via script in Windows 7 not mapping
    By dombera in forum Windows 7
    Replies: 5
    Last Post: 30th September 2010, 11:24 AM
  3. mapping printers via .vbs & GPO
    By techie211 in forum Windows Server 2000/2003
    Replies: 16
    Last Post: 12th June 2009, 10:46 AM
  4. Deploying printers via group policy
    By Southwell in forum Windows
    Replies: 16
    Last Post: 7th December 2007, 01:28 PM
  5. Replies: 10
    Last Post: 21st November 2006, 03:47 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •