Solved

Assigning printers to computer accounts.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

11 Experts available now in Live!

Get 1:1 Help Now