Solved

Add printer based on Local Computers Membership.

Posted on 2007-03-26
3
384 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

825 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