Solved

Add printer based on Local Computers Membership.

Posted on 2007-03-26
3
378 Views
Last Modified: 2010-04-16
Looking for a script that can connect printers depending on what membership the local computer belongs to...

The script would run at login, and should map printer \\DOMAIN\PRINTER1 if the computer belongs to a membership called "PRINTER1"

Here is a screen shot of the properties in the Active Directory for a computer, to give you an idea of where the computers membership is added...
http://img129.imageshack.us/img129/6651/untitledem4.jpg
0
Comment
Question by:Alan-Yeo
3 Comments
 
LVL 57

Expert Comment

by:Pete Long
ID: 18793247
Hello Alan-Yeo,

1.      Create an OU put in the Target Computers or users
2.      Create a group policy object called "Deploy Printer" and linked it to the above OU.
3.      If you are deploying to Computers add a STARTUP script, if you are deploying to USERS add a login script that points to "pushprinterconnections.exe" - ADD it to the "Deploy Printer" GPO
4.      Install a Network Printer on the server.
5.      Add the print server role to the server (Need access to i386 and CMPNENTS to do this - in R2).
6.      Open Print Management (Start > Administrative Tools > Print Management).
7.      Navigate to Print Servers > {Servername} > Printers > {Printername}.
8.      Right Click Printer > Deploy with Group Policy.
9.      The "Deploy with Group Policy" window opens > Click Browse > Browse to the Policy you created earlier > OK > Ensure the policy is listed > Tick Deploy to Computers.
10.      Click the ADD button "The printer will now be listed"
11.      Click Apply
12.      Dialog box should pop up and say "Printer Deployment or removal operation succeeded"
13.      Click OK > OK


Regards,

PeteLong
0
 
LVL 8

Accepted Solution

by:
deadite earned 500 total points
ID: 18794471
Don't have time to write this up, but it's pretty simply.... Just put these 2 scripts together:

The first script queries AD for the OU of the local computer:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec06/hey1206.mspx

Then add an if statement to see if it matches your OU and use the part of this script to add a printer:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec06/hey1212.mspx
0
 

Author Comment

by:Alan-Yeo
ID: 18814469
Superb! Works beautifully.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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

19 Experts available now in Live!

Get 1:1 Help Now