rocknrollstar (27th November 2009)
Hi everyone, I'm after a little confirmation that I do things in a sensible way! The longest part of the login script is the time it takes to add the printers. This is how we do it:
A System variable is set on each machine, called Location, and this helps determine which printer to set as the default. The script 'printers.bat', called in the login.bat script, contains the following:
IF %Location% == upstairs CON2PRT /CD \\SERVER\UpperSchool_HP
IF %Location% == upstairs CON2PRT /C \\SERVER\LowerSchool_HP
IF %Location% == upstairs CON2PRT /C \\SERVER\"ICT_Suite_HP_3600"
IF %Location% == upstairs CON2PRT /C \\SERVER\"New_Build_Upper_School"
IF %Location% == upstairs CON2PRT /C \\SERVER\"New_Build_Lower_School"
plus 2 other printers
Is this an efficient way to do it??
Thanks for your help.
Seems an okay way to do it, currently we use 2003 R2 which lets you deploy printers via group policy to rooms which is much easier.
rocknrollstar (27th November 2009)
what you might try is
Code:if %locaion% == upstairs call upstairs.bat goto eof if %location% == downstars call downstairs.bat goto eof
etc etc. This way you can setup the whole mapping of printers in a file and have it just a bit more organized.
rocknrollstar (27th November 2009)
Code:call %location%.bat
rocknrollstar (27th November 2009)
Cool, thanks. Out of all the things in the logon script, the printer bits take the longest.
Do you think the line
IF %Location% == upstairs CON2PRT /CD \\SERVER\UpperSchool_HP
Will actually try and check the UpperSchool printer over the network? If so, it means that several printers will be checked during each login, slowing things down.
We have Win2k still, until next A pril.
I haven't played with CON2PRT too much, but if it works like a normal network printer map, it will not only connect, but download and install the print drivers to the workstation. The good news with this after the first login it won't take so long as the network printers are already connected for the same user.
rocknrollstar (29th November 2009)
Drivers are per PC. If the PC already has it, it will not need to download it each time. It would just connect to the printer.
I don't know of a way to make sure the drivers aren't connected. But if the PC doesn't know how to talk to the printer, when you try to print you'll get gibberish.
Hi
I had a few problems with some machines and had to added the following at the start of the script
\\server\NETLOGON\CON2PRT /F
This wipes the printers off the machine and then they get reinstalled every time. I had a problem where I had a bad driver of some machines and it was not updating from the one on the print server.
I also had to put a copy of the con2prt in my netlogon and had to put the path to in in the script.
Richard
I use VBS scripts that map by OU (linked to location)... used the GPO deployment once... found no setting for default printers then went straight back to scripts
That's a useful switch for the CON2PRT, does it just delete the printers or does it kill the drivers as well, cleanspl style?
Just on kind of the same topic, does anyone know how to delete the XPS printer each time someone logs on?
Hey Ricki,
Here is what I use
I put this in the login script to call the vbs file
In my printer.vbs file I have the following:Code:cscript \\serverexch\NETLOGON\printer.vbs //B
Seems to work pretty good for me.Code:Option Explicit Dim objNetwork, strPrinter1,strPrinter2,strPrinter3 strPrinter1 = "\\Server\Brother" strPrinter2 = "\\Server\HPLJ1" strPrinter3 = "\\Server\HPLJ2" Set objNetwork = CreateObject("WScript.Network") objNetwork.AddWindowsPrinterConnection strPrinter1 objNetwork.AddWindowsPrinterConnection strPrinter2 objNetwork.AddWindowsPrinterConnection strPrinter3 WScript.Quit

If you are using vbs why not just add it as a login script in a gpo?
Ben

This is a VBS script which runs at logon I use to remove:
Microsoft Office Document Image Writer
Microsoft XPS Document Writer
Send To OneNote 2007
The script:
Hope this helps.strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery ("SELECT * FROM Win32_Printer")
For Each objPrinter in colInstalledPrinters
IF objPrinter.Name = "Microsoft Office Document Image Writer" THEN
objPrinter.Delete_
ELSEIF objPrinter.Name = "Microsoft XPS Document Writer" THEN
objPrinter.Delete_
ELSEIF objPrinter.Name = "Send To OneNote 2007" THEN
objPrinter.Delete_
END IF
Next
There are currently 1 users browsing this thread. (0 members and 1 guests)