disinfo Posted March 2, 2006 Posted March 2, 2006 Dear All, I am trying to implement a system in the school where by computers only have access to the printer which is in the same room as them.. To acheive this task, i have found a couple of simple .vbs scripts (see the bottom of this post im sure a lot of you have seen these before) How can i implement these on a per room basis? In my active directory I have containers set up for each room, I have tried adding the scripts under computer configuration --> startup and shutdown scripts and also under user configuration logon and logoff scripts but they dont seem to work. If i copy these scripts into a test students home folder and run them manually they work fine, so the rights are set up ok. Is there a better way that I should be doing this? Please help, this would really earn me some much needed brownie points (there is a governers meeting on whether to make me Network Manager on March 14th)!!!! My Scripts Adding A Printer ' Example VBScript to map a printer on a server ' Guy Thomas February 2004. ' ****************************** Option Explicit Dim netPrinter, UNCpath UNCpath = "\\server1\PRLaserjet" Set netPrinter = CreateObject("WScript.Network") netPrinter.AddWindowsPrinterConnection UNCpath WScript.Quit ' End of example VBScript Removing A Printer ' Example VBScript to remove a Printer ' Guy Thomas February 2004. ' ****************************** Option Explicit Dim DelPrint, UNCpath UNCpath = "\\server1\PRLaserjet" Set DelPrint = WScript.CreateObject("WScript.Network") DelPrint.RemovePrinterConnection UNCpath, true, true WScript.Quit ' End of Example Script to remove printer
Quackers Posted March 2, 2006 Posted March 2, 2006 What i do is create a package to install that script on the local machine, push it out via Active directory/Group Policy Software installs. Then for all users have them run the script on logon. When our students logon group policy runs c:\local\printers.vbs. They get the correct printers.vbs depending on which organisational container they are in.
ChrisH Posted March 2, 2006 Posted March 2, 2006 There are examples of such scripts in the scripts section. They basically see what the name of the machine is and set the printer up accordingly. You must have a good naming structure in place for this. Printers are added per user rather than machine so they wont wont work in a start up script. It it however handy to have one in the startup script to get the new drivers on the machine if there are any as it will install as system. If you dont do this then you may have trouble when locked down users are tryign to connect to a new printer.
Guest Posted March 2, 2006 Posted March 2, 2006 To use your room OUs to set logon / logoff scripts you will need to enable loopback processing. Enable the following: Computer Configuration\Administrative Templates\System\Group Policy\loopback processing mode And select Merge as the mode. Restart the workstation. Job done.
Geoff Posted March 2, 2006 Posted March 2, 2006 Yes, I use Ric's (heavily modified) printer script in the way ChrisH mentions above. Only difficulty I have is with WiFi Laptops. Its sometimes difficult to predict where they are. Perhaps I can query which AP they are connected to somehow?
disinfo Posted March 2, 2006 Author Posted March 2, 2006 To use your room OUs to set logon / logoff scripts you will need to enable loopback processing. Enable the following: Computer Configuration\Administrative Templates\System\Group Policy\loopback processing mode And select Merge as the mode. Restart the workstation. Job done. This sounds great, i've just tried enabling the loopback processing on one of the containers, but the scripts don't seem to be applying at the moment. I would really like this solution to work, as it would be best suited to our setup
alan-d Posted March 2, 2006 Posted March 2, 2006 Only difficulty I have is with WiFi Laptops. Its sometimes difficult to predict where they are. Perhaps I can query which AP they are connected to somehow? If you do find a way let me know I tried some time ago using the IP address and/or mac address of the Airstation but couldn't get it to work, but then again I'm rubbish when it comes to scripts
Geoff Posted March 2, 2006 Posted March 2, 2006 It looks possible, but there's precious little information on the MSNdis_80211_*.Blah WMI classes. I guess I'll have to download the WPSSDK from MS. Bah!
acb_ Posted March 2, 2006 Posted March 2, 2006 We have developed an approach which uses a shutdown script for the individual machines. We've found it works well for more ad hoc groupings which don't fit into our existing OU structure. Using Group Policy, we apply a shutdown script to machines (less likely to be cancelled by eager students) - this checks the security groups of the machine, and if they are of format CanPrintInsertPrinterName , looks in the Group's Description field which contains the relvant Printer share name. This then adds the specified printers to the machine in the system context which means that they are available for all users. In this way, we can easily manage printer additions to machines - it's simply a matter of plonking them in the right Security Groups. Our previous method was to use a little AddPrinter.cmd script (which used rundll32) on shutdown which we applied via Group Policy to our Machine OUs, passing the relevant printer(s) as required. Cheers Alison
marco84 Posted March 2, 2006 Posted March 2, 2006 The way we do the printing on a per room basis is also using Ric's script. . . . http://www.edugeek.net/index.php?name=Forums&file=viewtopic&t=1076 Its set as the logon script for pupils through AD, with a few extra lines of code added to map drives. Or if you have a .bat logon script you can amend that to run the .vbs script as part of its logon tasks.
tarquel Posted March 3, 2006 Posted March 3, 2006 I do it with a kixtart script - during user logon. Current there is one script for everyone and it is smart enough to know which room and user is logging on, to know which printer to setup for that user. Its pretty quick and works well. It does depend on machine names naturally but the user aspect is usually read from which usergroup they belong to i.e. photocopier is only mapped to staff members Regards Nath
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