Solved

Add printer based on Local Computers Membership.

Posted on 2007-03-26
3
390 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 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:Antonio King
ID: 18814469
Superb! Works beautifully.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 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