Solved

Assigning printers to computer accounts.

Posted on 2006-11-30
2
219 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 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