+ Post New Thread
Results 1 to 7 of 7
How do you do....it? Thread, Installing printers by location in Technical; Currently we use a vbscript to set the printers on a workstations when the user logs in. This may be ...
  1. #1
    Osprey's Avatar
    Join Date
    Mar 2007
    Location
    West Yorkshire
    Posts
    65
    Thank Post
    0
    Thanked 6 Times in 4 Posts
    Rep Power
    17

    Installing printers by location

    Currently we use a vbscript to set the printers on a workstations when the user logs in. This may be run either from All users\startup or from a loginscript in a GPO.

    What I would really like to have is one script that runs on all computers at startup or login which looks at the attribute of the computer class in Active Directory to see what it's location is, look up the correct printers for that location in a text file, and then install them.

    I have a script that will return the location from AD for a particular PC but I can't find out how to look up the printers from a text file.

    Has anyone else tried this sort of script?

    I have come across some software that does this. It is part of the Jigsaw suite that Akhtar install, it is based on Con2prt but it is copyrighted!

  2. #2

    Join Date
    Jul 2007
    Location
    Devon
    Posts
    233
    Thank Post
    8
    Thanked 9 Times in 8 Posts
    Rep Power
    16
    We're using the 2003 Server R2 Print Management Console to do this and deploy the printer on a per-machine basis, works really well.

    The other alternative is to turn on Loopback, and apply a user GPO to a computer OU for a similar effect.


    I had thought about doing the way you had mentioned too...

    The way I planned was to grab just the computer name though and run it through a


    Code:
    SELECT CASE strComputerName
    
    case 1
    
    add printer1
    
    case 2
    
    add printer2
    
    end select
    Of course, you could probably do exactly the same with the OU name that the computer is a part of.

    I'm sure there's something for this in the wiki too...

  3. #3
    Osprey's Avatar
    Join Date
    Mar 2007
    Location
    West Yorkshire
    Posts
    65
    Thank Post
    0
    Thanked 6 Times in 4 Posts
    Rep Power
    17
    The new bit on the forum which shows similar threads is very useful. I had tried searching and not found much but the similar threads produced some interesting links. The most promising is has a script called printers_195.vbs on page http://edugeek.net/forums/showthread.php?t=394 but unfortunately there are no page breaks in the script and it is difficult to read.

    Anyone have a copy of that thread with appropriate page breaks?

    Like some other users, I can't use the computer name as this is a unique name that can't be changed and computers are moved from one room to another.

  4. #4

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,653
    Thank Post
    1,258
    Thanked 781 Times in 678 Posts
    Rep Power
    236
    Quote Originally Posted by Osprey View Post
    I have a script that will return the location from AD for a particular PC but I can't find out how to look up the printers from a text file.
    That doesn't sound like a particularly hard problem to solve - a quick look up on Google for "vbscript read file" or similar should give you an answer. Make sure your script can find the text file in question - I should have thought the easiest thing to do would be to put your list of printers in a read-only hidden share somewhere on your network and have your script read that ("\\server\$hiddenShare\printers.txt" or whatever).

    --
    David Hicks

  5. #5

    Join Date
    Nov 2006
    Location
    Kendal
    Posts
    1,555
    Thank Post
    112
    Thanked 177 Times in 144 Posts
    Rep Power
    71
    Quote Originally Posted by Osprey View Post
    Currently we use a vbscript to set the printers on a workstations when the user logs in. This may be run either from All users\startup or from a loginscript in a GPO.

    What I would really like to have is one script that runs on all computers at startup or login which looks at the attribute of the computer class in Active Directory to see what it's location is, look up the correct printers for that location in a text file, and then install them.

    I have a script that will return the location from AD for a particular PC but I can't find out how to look up the printers from a text file.

    Has anyone else tried this sort of script?

    I have come across some software that does this. It is part of the Jigsaw suite that Akhtar install, it is based on Con2prt but it is copyrighted!
    We have a script that looks at the OU the PC is in from AD then assigns printers accordingly. You're welcome to that if you want.

  6. #6

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,240
    Thank Post
    55
    Thanked 278 Times in 186 Posts
    Rep Power
    134
    Hi

    Here's our script that identifies the PC location from the it's OU and sets appropriate printers (with most of the printers removed for ease of reading!)
    Attached Files Attached Files

  7. #7

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

SHARE:
+ Post New Thread

Similar Threads

  1. cgi-bin location
    By dezt in forum Web Development
    Replies: 7
    Last Post: 13th October 2007, 10:10 PM
  2. Location?
    By witch in forum Comments and Suggestions
    Replies: 14
    Last Post: 7th September 2007, 06:20 PM
  3. Mapping Printers based on Location
    By NeoNemesis in forum Windows
    Replies: 11
    Last Post: 6th August 2007, 08:03 AM
  4. Replies: 4
    Last Post: 19th April 2007, 09:22 AM
  5. Setting Printers Based On Room Location
    By ICTNUT in forum Scripts
    Replies: 34
    Last Post: 13th May 2006, 08:19 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
  •