+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
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 ...
  1. #16

    Join Date
    Feb 2007
    Posts
    363
    Thank Post
    174
    Thanked 38 Times in 34 Posts
    Rep Power
    40
    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!

    Thanks again.

  2. #17

    Join Date
    Mar 2008
    Location
    Doncaster
    Posts
    11
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    SYNACK,
    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

  3. #18
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,657
    Thank Post
    383
    Thanked 273 Times in 225 Posts
    Rep Power
    103
    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?

  4. #19
    ricki's Avatar
    Join Date
    Jul 2005
    Location
    uk
    Posts
    1,477
    Thank Post
    20
    Thanked 164 Times in 157 Posts
    Rep Power
    53
    Quote Originally Posted by burgemaster View Post
    deploy printers with group policy works perfectly.
    I think you need R2 if your running server 2003
    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.

    Richard

  5. #20


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    7,058
    Thank Post
    232
    Thanked 924 Times in 793 Posts
    Rep Power
    308
    Quote Originally Posted by mrbios View Post
    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?
    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

  6. #21

    Join Date
    Jun 2011
    Posts
    12
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile

    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

    '================================================= ==================================
    Option Explicit
    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)
    Next

    'Setting up registry If OS = win7 (It won’t affects Win XP)
    If Trim(VerBig) = “6.1” then
    Dim WSHShell
    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"
    End if

    'Installing printers
    WshNetwork.AddwindowsPrinterConnection "\\servername\printer name"
    WshNetwork.SetDefaultPrinter "\\servername\printer name"
    WshNetwork.AddwindowsPrinterConnection "\\servername\other printer name"

  7. #22

    Join Date
    Jun 2011
    Posts
    12
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  8. #23

    Join Date
    Feb 2011
    Posts
    94
    Thank Post
    6
    Thanked 24 Times in 15 Posts
    Rep Power
    12
    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.

  9. #24
    ricki's Avatar
    Join Date
    Jul 2005
    Location
    uk
    Posts
    1,477
    Thank Post
    20
    Thanked 164 Times in 157 Posts
    Rep Power
    53
    HI

    I have had to give up on scripts to apply printers to windows 7 machines and have had to go over to group policy.

    Richard

  10. #25

    Join Date
    Jan 2010
    Location
    Rossendale
    Posts
    42
    Thank Post
    2
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    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.



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Windows 2003 R2 Printer Management
    By Simcfc73 in forum Windows Server 2000/2003
    Replies: 50
    Last Post: 4th February 2010, 03:44 PM
  2. Windows 7 Printer Scripting HELP!!
    By Scottyboy99 in forum Windows 7
    Replies: 13
    Last Post: 6th November 2009, 02:44 PM
  3. VBS to remove Windows Firewall exception
    By simons2009 in forum Scripts
    Replies: 9
    Last Post: 3rd June 2009, 09:18 AM
  4. Printing to Windows Printer
    By ahunter in forum Mac
    Replies: 4
    Last Post: 1st February 2008, 01:35 PM
  5. Replies: 7
    Last Post: 27th September 2006, 09:19 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •