Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setup Printers based on location 1

Status
Not open for further replies.

suseli

Technical User
Dec 9, 2005
77
GB
I have a lan with over 120 windows 2000 clients in 3 different rooms. Each room has a network printer.

When user login frm room 1 and prints, i want it to be printed frm room 1 printer.
And if user login frm room 2 and prints, i want it to be printed frm room 2 printer.
and so on for room3.

Will be greatful if anybdy can help.

 
Mark, your scripts are too advanced for me.
 
suseli do your computers have location specific names e.g. Room1_001 and Room2_001?

If so then i have a fairly straight forward script that will do what you need on a small LAN. I won't be able to post it untill tomorrow though.
 
computers are named as follows:
wrkstn005 - wrkstn056 in room1
wrkstn060 - wrkstn100 in room2
wrkstn101 - wrkstn120 in room3

 
Are the stations organised into OU's by room for software allocation?
If so you can use loopback processing in merge mode to add printers to all computers in that OU.




At colleges that i have setup i typically give the stations names by room e.g.

IT1_01
IT1_02

IT2_01
IT2_02

and so on. This makes it possible to map all of the computers in that room to one printer without having to specify every computer. Here's an example of the script it reads the first three characters from the computer name and then maps the appropriate printer.

Code:
'Adds the appropriate network printer for the room

On error resume next


Set WSHNetwork = CreateObject("WScript.Network")
Set Network = CreateObject("Wscript.Network") 
compname = network.computername
room = left(compname,3)





'Begin install new printrs by machine name
'--------------------------------------------


Select Case room

	
	Case "IT1"

Network.AddwindowsPrinterConnection "\\server\printer1"
Network.SetDefaultPrinter "\\server\printer1"


	Case "IT2"

Network.AddwindowsPrinterConnection "\\server\printer2"
Network.SetDefaultPrinter "\\server\printer2"

	Case "IT3"

Network.AddwindowsPrinterConnection "\\server\printer2"
Network.SetDefaultPrinter "\\server\printer2"



case else
 
End Select


'Clean Up Memory We Used
set WSHNetwork = Nothing
Set WSHPrinters = Nothing
Set Network = Nothing
  

'Quit the Script
wscript.quit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top