Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add printer based on Local Computers Membership.

Posted on 2007-03-26
3
Medium Priority
?
394 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:Antonio King
[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
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 2000 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:Antonio King
ID: 18814469
Superb! Works beautifully.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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…
Suggested Courses

650 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