+ Post New Thread
Results 1 to 9 of 9
Windows Server 2008 R2 Thread, Connect to printer on login script in Technical; Has anyone got a simple connect to a shared printer script please? Not having much luck with Group Policy, so ...
  1. #1
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    4,002
    Thank Post
    983
    Thanked 477 Times in 398 Posts
    Blog Entries
    12
    Rep Power
    98

    Connect to printer on login script

    Has anyone got a simple connect to a shared printer script please?

    Not having much luck with Group Policy, so I figure just running a logon script might be easier!

  2. #2
    AJWhite1970's Avatar
    Join Date
    Sep 2012
    Location
    Wiltshire
    Posts
    355
    Thank Post
    96
    Thanked 82 Times in 62 Posts
    Rep Power
    18
    printer.vbs

    On Error resume Next
    set objNetwork = WScript.CreateObject("WScript.Network")
    set objShell = WScript.CreateObject("WScript.Shell")

    'Add Network printers
    objNetwork.AddWindowsPrinterConnection "\\quartz\HP LaserJet P2015 BG02"
    objNetwork.AddWindowsPrinterConnection "\\quartz\Kyocera FS-3540MFP MATHS"

    'Set Default Printer
    objNetwork.SetDefaultPrinter "\\quartz\HP LaserJet P2015 BG02"

    Regards
    Andrew

    Edit: Forgot to say, ours is called using "cscript \\quartz\profiles\printers\vbs\%computername%.vbs" and we have one vbs script per workstation, so we can easily change the association of a printer from machine to machine
    Last edited by AJWhite1970; 18th September 2013 at 02:45 PM.

  3. Thanks to AJWhite1970 from:

    zag (18th September 2013)

  4. #3

    fiza's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    2,372
    Thank Post
    477
    Thanked 339 Times in 287 Posts
    Rep Power
    158
    We use con2prt with a location variable as we need to map different printers depending on location.

    PeteNetLive - KB0000510 - Windows - Location Based Printing with con2prt

  5. Thanks to fiza from:

    zag (18th September 2013)

  6. #4

    Join Date
    Jan 2009
    Posts
    22
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    we have been using con2prt with an environment variable for years..

    however... ive just been looking at some windows 7 machines that are using this system.. (weve had win7 machines in school now for over a year..)

    and con2prt is crashing the print spooler meaning the printers arent added..

    has anyone else experienced this? and if so what did you do to remedy it?

    Thanks!

  7. #5

    Join Date
    Jan 2007
    Location
    Nottinghamshire
    Posts
    531
    Thank Post
    2
    Thanked 84 Times in 58 Posts
    Rep Power
    39
    What's the server running the spooler's OS?

  8. #6

    Join Date
    Jan 2007
    Location
    Nottinghamshire
    Posts
    531
    Thank Post
    2
    Thanked 84 Times in 58 Posts
    Rep Power
    39
    I read the computer's OU to work out printer settings:

    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objWshNetwork = CreateObject("WScript.Network")
    strNameStr = objSysInfo.ComputerName

    ' Get the computer name which contains the full path to the root
    arrSplitArray = split(strNameStr,",") ' Split the string into components
    strSchoolOUName = mid(arrSplitarray(4),4) ' Get the School Name without the OU= prefix
    strRoomOUName = mid(arrSplitarray(1),4) ' Get the Room without the OU= prefix

  9. #7

    Join Date
    Jan 2009
    Posts
    22
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    the server they're connecting to is server 2003...

    however.. con2prt is crashing the windows 7 machines local spooler..

  10. #8

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    756
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

  11. #9

    Join Date
    Jan 2007
    Location
    Nottinghamshire
    Posts
    531
    Thank Post
    2
    Thanked 84 Times in 58 Posts
    Rep Power
    39
    Quote Originally Posted by spacehopper View Post
    the server they're connecting to is server 2003...

    however.. con2prt is crashing the windows 7 machines local spooler..
    It's probably Print Ports and Drivers may not displayed on a computer that is running Windows 7

    I set up a GPO, computer, preferences, windows settings, registry item to fix it



SHARE:
+ Post New Thread

Similar Threads

  1. Connecting to device on different IP range
    By ckhorder1 in forum Wired Networks
    Replies: 2
    Last Post: 8th November 2011, 08:35 AM
  2. Replies: 2
    Last Post: 3rd February 2011, 06:59 PM
  3. printers and login scripts
    By rocknrollstar in forum Windows
    Replies: 22
    Last Post: 22nd April 2010, 04:47 PM
  4. Connecting to wireless on DOMAIN
    By johnkay21 in forum Windows
    Replies: 11
    Last Post: 5th July 2007, 02:33 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
  •