?
Solved

Add printer based on Local Computers Membership.

Posted on 2007-03-26
3
Medium Priority
?
396 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

850 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