Poll: Was this script helpful?

Be advised that this is a public poll: other users can see the choice(s) you selected.

+ Post New Thread
Page 7 of 11 FirstFirst ... 34567891011 LastLast
Results 91 to 105 of 165
Scripts Thread, A Printer Script in Coding and Web Development; Sorry guys, how can I manually set my TS clients ID? Currently it's picking the MAC address. I've tried manually ...
  1. #91
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    Sorry guys,
    how can I manually set my TS clients ID? Currently it's picking the MAC address. I've tried manually creating a computer account in AD with the correct GUID but it's not working.

  2. #92

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Re: A Printer Script

    As per Ric's reply, the thinstation.hosts file.

  3. #93
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    Ah yes, I see.

    Thanks for your help. I'll be back I'm sure

  4. #94
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    This is all looking good so far, however the script isn't running at logon. I have added the vbs script to %systemroot%\system32 and told the registry to call it as in the Microsoft link above. However, it isn't running.

    Any ideas?

  5. #95

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Re: A Printer Script

    You must run the script at machine startup and user login otherwise the printer drivers are not installed correctly (due to users not having enough permissions to load printer drivers).

  6. #96
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    How can I run the script at machine startup on a thinclient?

  7. #97

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Re: A Printer Script

    You don't. You run it on the Terminal Server.

  8. #98
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    Sorry Geoff, you've confused me. I have to run the script to connect the printers at the terminal server startup?? This hasn't been mentioned anywhere else in this thread.

  9. #99

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: A Printer Script

    I think that Geoff has muddied the water slightly...

    You need to have ALL the printer drivers installed on your terminal servers. You can do this with a script such as the following:

    Code:
    ' Startup script to add network printer drivers at startup
    ' Author: Ric Charlton, 11/04/07
    
    ' Declare variables and enumerate existing printer connections
    On Error Resume Next
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Set oPrinters = WshNetwork.EnumPrinterConnections
    
    ' Delete existing connections to network printers
    For i = 0 to oPrinters.Count - 1 Step 2
                On Error Resume Next
    	    if Left(oPrinters.Item(i), 3) <> "lpt" And Left(oPrinters.Item(i), 3) <> "usb" then
                 	WshNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, true
                else WScript.Echo "No network printers found"
                end if
    Next
    
    ' Add printer connections
    ' Variable to select print server
    Dim printServer
    printServer = "debian-02"
    
    WshNetwork.AddWindowsPrinterConnection "\\" & printServer & "\PRINTER-01"
    WshNetwork.AddWindowsPrinterConnection "\\" & printServer & "\PRINTER-02"
    ' Add more printers here by copying above lines
    
    ' Delete connections to network printers
    oPrinters = WshNetwork.EnumPrinterConnections
    For i = 0 to oPrinters.Count - 1 Step 2
                On Error Resume Next
    	    if Left(oPrinters.Item(i), 3) <> "lpt" And Left(oPrinters.Item(i), 3) <> "usb" then
                 	WshNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, true
                else WScript.Echo "No network printers found"
                end if
    Next
    If you run the above script at startup, it will ensure that all your printers are always available to the computers since users generally do not have sufficient priviledges to install printer drivers.

    You then need to run the printers.vbs script as a login script (best called from a GPO... User Configuration -> Windows Settings -> Scripts).

    No changes need to be made to your thin client devices (except giving them meaningful names).

    BTW Andi.... could you please add your location to your profile?

  10. #100

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Re: A Printer Script

    Yes, otherwise the Terminal Server will not have the drivers for the printers installed correctly. Thus they don't get setup correctly when the users login. Thus no/missing printers.

    See these prior threads on the subject:

    http://www.edugeek.net/index.php?nam...ewtopic&t=5736
    http://www.edugeek.net/index.php?nam...ewtopic&t=3653
    http://www.edugeek.net/index.php?nam...iewtopic&t=445

  11. #101
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    I see, thanks Ric and Geoff for your help so far.

    So if the users run the logon script no matter where they logon it will only map the printer if they are on a terminal station of course. (We have both thin and thick clients here).

    I'll add my location now.

  12. #102

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: A Printer Script

    How good am I? Wikified all this at http://www.russdev.com/edugeek/doku....ter_assignment

  13. #103
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,946
    Thank Post
    235
    Thanked 48 Times in 44 Posts
    Blog Entries
    2
    Rep Power
    45

    Re: A Printer Script

    Great job!

  14. #104
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: A Printer Script

    Ric's script seems to be working a treat for my thin clients.

    Thanks for all your help.

  15. #105

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: A Printer Script

    @Andi: As mentioned in the Wiki, this script will work on both fat and thin clients without modification.... that's how I use it

SHARE:
+ Post New Thread
Page 7 of 11 FirstFirst ... 34567891011 LastLast

Similar Threads

  1. logon script for printer
    By ozzy in forum Scripts
    Replies: 6
    Last Post: 22nd November 2007, 03:03 PM
  2. Printer Script
    By faza in forum Scripts
    Replies: 9
    Last Post: 14th September 2007, 08:30 AM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  4. Add printer script not workling
    By mark in forum Windows
    Replies: 6
    Last Post: 15th September 2005, 10:07 AM
  5. Script to delete printer
    By tosca925 in forum Scripts
    Replies: 2
    Last Post: 31st August 2005, 07:45 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
  •