?
Solved

Assigning printers to computer accounts.

Posted on 2006-11-30
2
Medium Priority
?
224 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 1300 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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

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 …
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 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