Solved

Assigning printers to computer accounts.

Posted on 2006-11-30
2
215 Views
Last Modified: 2010-03-18
I am currently using a VB logon script to create shared printers. For some reason not all printers listed in AD were appearing on all PCs. Not a big deal, I like using the script.

What I would like is to set the printers and the default differently on each workstation regardless of user.

I have my OUs set up for both users and computers.

My Business
     -Computers
          -SBSComputers
               -Site1
                    -Customer Service
                    -Data Entry
                    -Copy Room
               -Site2
                    -Customer Service
                    -Data Entry
                    -Copy Room
               -TEST_OU
          -SBSServers
     -Users
          -SBSUsers
               -Site1
                    -Customer Service
                    -Data Entry
                    -Copy Room
               -Site2
                    -Customer Service
                    -Data Entry
                    -Copy Room
               -TEST_OU

I have created different logon scripts to use with different groups. Each script has a different default printer (see script below).

I have sucessfully used the script through group policy for user accounts. I cannot seem to get it to work on computer accounts.

In group policy editor, I create a policy to run this script at logon. If I embed the policy under the Users TEST_OU, it works. When users in that OU logon, the get the message, "Connected to Printers and Public Directory" and all the printers are created and the default is set.

How can I get that to work on a Computer OU?


My Script:
---------------------------------------------------------------------------------
Set objNetwork = CreateObject("WScript.Network")
on error resume next
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objNetwork = CreateObject("WScript.Network")
Set objApp = CreateObject("WScript.Shell")

WshNetwork.MapNetworkDrive "P:", "\\Server01\Public"
 
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy1"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy2"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy3"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy4"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy5"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy6"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy7"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy8"
objNetwork.AddWindowsPrinterConnection "\\Server01\Copy9 RPCS"
objNetwork.AddWindowsPrinterConnection "\\Server01\MailRoom1"
objNetwork.AddWindowsPrinterConnection "\\Server01\SAVINMLP"
objNetwork.AddWindowsPrinterConnection "\\Server01\HPLaserJet"
objNetwork.AddWindowsPrinterConnection "\\Server01\Color1"
objNetwork.AddWindowsPrinterConnection "\\ServerCHI\CHCOPY01"
objNetwork.AddWindowsPrinterConnection "\\ServerCHI\CHCOPY02"

WshNetwork.SetDefaultPrinter "\\Server01\Copy9 RPCS"
'WshNetwork.SetDefaultPrinter "\\ServerCHI\CHCOPY01"

WScript.Echo "Connected to Printers and Public Directory"

WSCript.Quit
----------------------------------------------------------------------------------------
0
Comment
Question by:chris48178
2 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 325 total points
ID: 18046414
Do you want these printers to be mapped for everybody who logs onto a particular computer?

Logon/Logoff scripts are under the User Configuration node of Group Policy and thus do not normally apply to computers.  There are a couple of ways to get around this.

A. Link the GPO to a site in AD Sites and Services instead of linking it to an OU.  It will then apply to users who log onto any computers at that site.

B. Link the GPO to a computer OU, and enable "Group Policy loopback processing mode" under Computer Configuration\Administrative Templates\System\Group Policy.  Select "Merge" mode.  This will cause User Configuration settings in that GPO to be added for users who log onto those computers.  Their normal settings from other GPOs will still be applied, as long as you don't select "Replace" mode.
0
 

Author Comment

by:chris48178
ID: 18047205
The solution in option B worked perfectly. Thank you so much Shift-3!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now