Solved

Assigning printers to computer accounts.

Posted on 2006-11-30
2
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

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 …
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

759 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