projector1 Posted October 18, 2006 Posted October 18, 2006 i would be greatful if you could help me out here. I have created a few vb scripts that map networked printers. I have 12 of these scripts for the different classrooms. How would i assign these so that if a pupil logs on in a particular room they get the networked printers installed in that room. Would i have to create gpos and assign them to the various classroom ou's ( i have all over pc's organised in seperate ou's based on the room they are in) many thanks
Jake Posted October 18, 2006 Posted October 18, 2006 We use a logon script that checks the name of the PC in the room (say for example 101A), and then it installs the printers allocated to that room number. This way wherever a pupil logs in they get the relevant printers for that room. There have been a few threads similar to this on the forums, a few of the threads have example scripts, best to do a forum search and root them out
ICTNUT Posted October 18, 2006 Posted October 18, 2006 It depends on how you have your PC's named. For example our PCs are named as -- So the simplest thing would be to create a single VB script the gets the PC name and then by looping through a select statement match the PC namr to the printer specified for that PC/Room. I have then added this script to our Student GPO so at logon the script runs and the printers are added on a room by room basis.
Geoff Posted October 18, 2006 Posted October 18, 2006 Yes, there's a script posted by Ric in the scripts forum that does room based printer assignment based on PC hostnames. http://www.edugeek.net/index.php?name=Forums&file=viewtopic&t=404
robert.mabbutt Posted October 18, 2006 Posted October 18, 2006 At my place we place an Environmental Variable called location on the pcs and as the value we put the room name/number. During login the logon batch file calls a seperate printers one, checks the variable and installs the correct printer or printers and sets the default one for us. Robert
bossman Posted October 18, 2006 Posted October 18, 2006 Get yerself a CC3 network does all this with just a few clicks of the mouse.
k-strider Posted October 18, 2006 Posted October 18, 2006 I haven't tried this, but if you have W2k3 R2 you can push printers either to Computers or Users... we use a VB scripts that look at the computer name if its room43Somthing they get the 43 printers etc... one on login and one on logout.. and they work well so I haven't bothered exploring using R2s Printer push option.. I believe you need to deploy and have running an EXE on the PCs from the brief gander I had at it…
djm968 Posted October 18, 2006 Posted October 18, 2006 This script maps printers based on group membership. ' printermap.vbs ' VBScript to map different groups to different printer shares. ' Author Darren Mussenden ' Version 1.2.0 - September 27 2006 ' -----------------------------------------------------------------' Option Explicit Dim objNetwork, objUser, CurrentUser Dim strGroup Const hu5_Group = "cn=hu5" Const enwr_Group = "cn=enwr" Const scgf_group = "cn=scgf" Const ss_group = "cn=ss" Const maof_group = "cn=maof" Set objNetwork = CreateObject("WScript.Network") Set objUser = CreateObject("ADSystemInfo") Set CurrentUser = GetObject("LDAP://" & objUser.UserName) strGroup = LCase(Join(CurrentUser.MemberOf)) If InStr(strGroup, hu5_Group) Then objNetwork.AddWindowsPrinterConnection("\\NAS01\HU5 Black Laser") objNetwork.AddWindowsPrinterConnection("\\NAS01\HU5 Colour Laser") objNetwork.SetDefaultPrinter "\\NAS01\HU5 Black Laser" ElseIf InStr(strGroup, enwr_Group) Then objNetwork.AddWindowsPrinterConnection("\\NAS01\ENWR Black Laser") objNetwork.AddWindowsPrinterConnection("\\NAS01\ENWR Colour Laser") objNetwork.SetDefaultPrinter "\\NAS01\ENWR Black Laser" ElseIf InStr(strGroup, scgf_Group) Then objNetwork.AddWindowsPrinterConnection("\\NAS01\SCGF Black Laser") objNetwork.AddWindowsPrinterConnection("\\NAS01\SCGF Colour Laser") objNetwork.SetDefaultPrinter "\\NAS01\SCGF Black Laser" ElseIf InStr(strGroup, ss_Group) Then objNetwork.AddWindowsPrinterConnection("\\NAS01\SS Black Laser") objNetwork.AddWindowsPrinterConnection("\\NAS01\SS Colour Laser") objNetwork.SetDefaultPrinter "\\NAS01\SS Black Laser" ElseIf InStr(strGroup, maof_Group) Then objNetwork.AddWindowsPrinterConnection("\\NAS01\MAOF Black Laser") objNetwork.AddWindowsPrinterConnection("\\NAS01\MAOF Colour Laser") objNetwork.SetDefaultPrinter "\\NAS01\MAOF Black Laser" End If WScript.Quit
djm968 Posted October 18, 2006 Posted October 18, 2006 Get yerself a CC3 network does all this with just a few clicks of the mouse. I would rather hit my left te$%&cle with a large blunt object but each to their own. How many new PC's would the cost of your RM support bought last year?
webman Posted October 18, 2006 Posted October 18, 2006 We don't pay RM for support. Let me turn that round ... how many computers can you buy for the time spent hacking batch files together and paying through the nose for 3rd party software to do what RM CC3 does?
djm968 Posted October 18, 2006 Posted October 18, 2006 “hacking batch files" is an occupational hazard of a "real" network manager. I am all for making your life as easy as possible but scripting is an valuable skill to learn, especially if your career path takes you into the “real world†where there is no RM to hold your hand.
webman Posted October 18, 2006 Posted October 18, 2006 “hacking batch files" is an occupational hazard of a "real" network manager. Sorry? You're saying all Network Managers who run CC3 networks aren't "real"? (Whatever your definition of that is). I find that remark quite insulting (even though I am not a Network Manager), as would a few others on here I imagine. I am all for making your life as easy as possible but scripting is an valuable skill to learn, especially if your career path takes you into the “real world†where there is no RM to hold your hand. I quite agree. Personally speaking I'm perfectly capable of scripting (in several languages), and have been doing so for 7 years. That doesn't mean we shouldn't run a CC3 network; why re-invent the wheel?
NetworkGeezer Posted October 18, 2006 Posted October 18, 2006 Yeah careful djm968 or RussDev might just zap you. He runs RM CCx, I think.
Joedetic Posted October 18, 2006 Posted October 18, 2006 We'd used to do it with environment variables and batch files at logons. But everytime we re-imaged a machine we'd get called away to go and do another job and forget to set an environment variable and then a week later we'd get complaints about printers not working, so it got moved over to VB script.
djm968 Posted October 18, 2006 Posted October 18, 2006 I apologise if I have offended anyone by that comment, it just pi$&es me of a little when a guy or girl posts a genuine question or genuinely needs help and we get comments like “get a CC3 network†like yeah lets order one tomorrow! That really helps.
NetworkGeezer Posted October 18, 2006 Posted October 18, 2006 @joedetic Yeah ...the problem with monolithic batch files is that the Windows command processor doesn't do string splicing. This means you either have to name each printer or put the room attribute in an enviromental variable. Of course room identifiers don't matter so much if the script is run from a GPO which then selects the right computers. For those prefering the centralisation of monolithic scripts it's better to use a grown up language such as VBS/JScript or KiXtart
djm968 Posted October 18, 2006 Posted October 18, 2006 VB Script VIA GPO is the way to go and if your computer naming convention includes a room identifier you will only need to create one GPO and script.
BradP. Posted October 18, 2006 Posted October 18, 2006 I use a vbscript that maps printers by computer OU.
Ric_ Posted October 18, 2006 Posted October 18, 2006 I'd suggest that you just use my VBScript as Geoff mentions earlier in the post. it works for a lot of people and can be set up in 10mins - after which you only need to change it if you add additional printers or suites. The script also works for Citrix.
SpuffMonkey Posted October 18, 2006 Posted October 18, 2006 We have an OU for each printer and put the PCs (in AD) in the appropriate OU. At login a script runs which looks at the OU and assigns a default printer based on that. I prefer doing this - as all the administration is centralised, rather than having local variables on the PCs.
bossman Posted October 19, 2006 Posted October 19, 2006 djm968 apology accepted: I have spent the past 6 years aquiring professional status in my field i.e. network manager, 2k3MCSE, MCSA, MCP and I am on the last leg of my CCNA. So often on this forum do I hear the name of RM on the lips nay in the back of peoples throats as if choking blindly at the near mention of a CC3 network. I am paid to manage the network to the best of my ability and when i concluded after a 6 month system analysis of the school i came up with a ten year plan which is now 5 years in the making after studying the other tools which where on offer, Vanilla, Ranger, CSE, Karoshi and other managed systems i came across RM CC3 and this is the system I use because I have found that it does for me what i want from a network. It is flexible enough to add Linux servers to and many other peripherals including MACs. I don't get paid very much and i know if i moved into industry i would get much more but like you i am passionate about my job and what i do for the school, so lets not get into the argument about who is a real network manager because of the ability to script i think it is really irrelevent on this forum as we all bring something to the table to help each other. live long and prosper my friend djm968
djm968 Posted October 19, 2006 Posted October 19, 2006 djm968 apology accepted: I have spent the past 6 years aquiring professional status in my field i.e. network manager, 2k3MCSE, MCSA, MCP and I am on the last leg of my CCNA. So often on this forum do I hear the name of RM on the lips nay in the back of peoples throats as if choking blindly at the near mention of a CC3 network. I am paid to manage the network to the best of my ability and when i concluded after a 6 month system analysis of the school i came up with a ten year plan which is now 5 years in the making after studying the other tools which where on offer, Vanilla, Ranger, CSE, Karoshi and other managed systems i came across RM CC3 and this is the system I use because I have found that it does for me what i want from a network. It is flexible enough to add Linux servers to and many other peripherals including MACs. I don't get paid very much and i know if i moved into industry i would get much more but like you i am passionate about my job and what i do for the school, so lets not get into the argument about who is a real network manager because of the ability to script i think it is really irrelevent on this forum as we all bring something to the table to help each other. live long and prosper my friend djm968 Many thanks Bossman, I was having a bad day yesterday spent most of it fighting an LEA over a local admin password for a client and they eventually send a technician out who didn't know how to change a D/G manually. I am not blaming him, but you would have thought that after two days of battle they would have at least sent someone who had half a chance of restoring some confidence in them. I know I could have cracked the password but I thought it was polite to ask for permission..... Big Mistake. Some of them emails I got from them are quite amusing and I might post the whole episode on my Blog. I was very passionate about my job as a network manager in my previous school, I felt I was really making a difference and still miss it now but you can only live on emotional reward for so long. It is no accident that my client base is predominantly education I was not going to waste the skills and knowledge gained from the unique environment an educational background gives you and I have been lucky. I am still passionate but now my financial package matches the emotional rewards. So proper I will but as Benjamin Franklin said….. “wish not so much to live long as to live wellâ€
browolf Posted October 31, 2006 Posted October 31, 2006 we set a prefix on computer names so can identify rooms then add printers thru a batch file matching the prefixes. if theres a problem with a print server or queues which happens from time to time, its easy to switch the queues to an alternative print server. its simple and relatively foolproof
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now