Windows 7 Thread, Windows 7 printer vbs in Technical; Cheers for the response everyone. I have actually just put XP on for now, until I upgrade the servers to ...
20th April 2010, 04:15 PM #16
Cheers for the response everyone. I have actually just put XP on for now, until I upgrade the servers to 2008.
I will defo use the info in the summer!
20th April 2010, 09:29 PM #17
- Rep Power
I'm using vbs. The 7 machines are 32 bit.
I got a call after I'd been tinkering with the 7 machines to say that nobody could print so I toddled off back to find that the print spooler service had stopped and the printers were no longer installed on the server. I got that back up and running by starting the service and reinstalling the printers, but when I tried to reinstall, it said the printer was already in use, so I created a new printer, and just as I'd finished installing it, the other 2 printers appeared in the printers folder as if by magic. Don't know what that was all about.
Anyway, I dug deeper and found that staff (with roaming profiles) could also see the printers, but pupils (with mandatory profiles) couldn't, so it started to look like group policy issues when logging on as a user even though the printer script runs on an OU that contains computers and not users.
I only work there for 2 hours twice a week so I will investigate more when I'm back in, but it seems to be heading towards a policy on the users OU that is stopping the script working.
I will report back when I've found the culprit
20th April 2010, 10:02 PM #18
When people use the group policy assigned printers are you using the server 2008 R2 route of deploying them in GP or creating the policy manually with a loopback processing policy to assign a shared printer it to a machine OU?
21st April 2010, 09:09 AM #19
This works but you cannot set the default until you have windows 2008 servers. This is the situation I have so I am sticking with the scripts for now.
Originally Posted by burgemaster
21st April 2010, 01:57 PM #20
im going to the print management console right clicking the printer in question and selecting deploy with gpo then assigning it to a printers gpo repeat for otehr printers setting them all as per pc rather than per user then adding pushprinterconnections to all user startup sp when users log in the printers appear
Originally Posted by mrbios
1st June 2011, 03:40 AM #21
- Rep Power
Here is my solution to deploy printers on a Windows 7 workstation from a Windows 2003 servers login script.
This vbs is going a bit further as it will suppress the prompt for any software installation. Modify it as you need.
'This script will disable Driver Signing, UAC, LUA as well as the prompt for any software installation with Windows 7
Dim objWMI, objItem, colItems, strComputer, VerOS, VerBig, Ver9x, Version9x, OS, OSystem
Set WshNetwork = CreateObject("WScript.Network")
strComputer = "."
'Getting OS version
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
VerBig = Left(objItem.Version,3)
'Setting up registry If OS = win7 (It won’t affects Win XP)
If Trim(VerBig) = “6.1” then
Set WSHShell = CreateObject(“WScript.Shell”)
‘Adding point and print to registry (This is part of the policy in win 2008)
‘These reg keys don’t exist and will be created.
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\PointAndPrint\restricted", "0", "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\PointAndPrint\TrustedServers", "0", "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\PointAndPrint\ServerList", ""
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\PointAndPrint\InForest", "1", "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\NoWarningNoElevationOnInstall", "1", "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Wi ndows NT\Printers\PointAndPrint\UpdatePromptSettings", "2", "REG_DWORD"
'Disable checking if the driver is certified by Microsoft
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Win dows NT\Driver signing\BehaviorOnFailedVerify", "0", "REG_DWORD"
'Disable UAC and LUA (Won't prompt to run for any software)
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Cur rentVersion\Policies\System\EnableLUA", "0", "REG_DWORD"
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Cur rentVersion\Policies\System\ConsentPromptBehaviorA dmin", "0", "REG_DWORD"
WshNetwork.AddwindowsPrinterConnection "\\servername\printer name"
WshNetwork.SetDefaultPrinter "\\servername\printer name"
WshNetwork.AddwindowsPrinterConnection "\\servername\other printer name"
1st June 2011, 03:45 AM #22
- Rep Power
If you copy this script, delete the extra space in 'Wi ndows" or 'Cur rentVersion".
This is is a result of a cut and paste as the lines were truncated in my editor
1st June 2011, 01:08 PM #23
- Rep Power
If you dont wish to run a different script on each of your OU's you can add the printer deployment to your logon script, it picks up what OU the computers is in and uses a case statatement to deploy the printer. Maybe of some help to people so here is a link - Printer deployment script - Works with Windows 7 server 2008 / windows xp 2003. Not sure about the windows 7 - 2003 combo though.
6th June 2011, 08:54 PM #24
I have had to give up on scripts to apply printers to windows 7 machines and have had to go over to group policy.
7th June 2011, 02:41 PM #25
- Rep Power
I used to use this one Implementing powerful and flexible login scripts! - VBScript FAQ - Tek-Tips however with the introduction of CSP i dont really need it anymore.
By Simcfc73 in forum Windows Server 2000/2003
Last Post: 4th February 2010, 03:44 PM
By Scottyboy99 in forum Windows 7
Last Post: 6th November 2009, 02:44 PM
By simons2009 in forum Scripts
Last Post: 3rd June 2009, 09:18 AM
Last Post: 1st February 2008, 01:35 PM
Last Post: 27th September 2006, 09:19 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)