Advertisement

12.01.2008 at 03:29PM PST, ID: 23948382
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.1

How can I run rundll32 printui.dll,PrintUIEntry via group policy to install printers on systems.

Asked by splendidtechnology in Windows 2000 Operating System

Tags: , , ,

Ok, I should give more of an explaination....

I have created a .cmd file (could just as well be a .bat file, i just felt like making a .cmd today).  Inside of this file I have it running the command:
        rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2

        start /wait sc \\%1 stop spooler
        start /wait sc \\%1 start spooler

I then have made a GPO to run the newly created cmd file.  "\\domain\NETLOGON\PrinterAdd.cmd"  and as variables, I have %COMPUTERNAME% and servername\printershare.  (Of note, the GPO is applied to a Computer OU, and the script is set in the Computer Settings of the GPO.   The GPO is set to Loopback - Merge.)

This should, run the command and in place of the variables %1 and %2 insert the appropriate values so that we end up with something that equates to:
rundll32 printui.dll,PrintUIEntry /ga /c\\ComputerName /n\\Servername\PrinterShare

Which would, err, should add the printer globally (for any and all users on the local system).  I added the spooler bit at the end so that it will force a restart of the spooler service so I dont have to log off and log back on to see the newly added printer.

In fact, it does work correctly.  However, the problem I run into, is that the above script needs to be ran as local admin rights.  So any domain admin account or local admin account will do.  The problem is, that I want to use this for a lab in a school where the students and teachers will not have the appropriate access to run this.  In my testing, I created a "test" student account and it when I logged on the first time, the printer was there, I deleted it and restarted and relogged in again as the same user, and the script is not being applied.

I believe the reason for this is the lack of credentials.  So to my question.

Is there a way to get the above code to work for restricted users?  I.e. something similar to a RunAs  but for an entire policy?  I would prefer to not have the username/password hard coded into the script, but maybe as a second variable, or have it call another file that would make it easy to check the credentials used by the script at all locations it gets called on.

I could use the vbs scripting method of objNetwork.AddWindowsPrinterConnection strUNCPrinter  but I have had some difficulties lately and am looking for an alternative.  And I dont want to make it so that one of the people who do have admin access have to go by and log in for the script to work everytime a student decides to delete their printer.

Any help is appreciated.Start Free Trial
[+][-]12.02.2008 at 12:15PM PST, ID: 23080345

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.03.2008 at 08:24AM PST, ID: 23087451

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.05.2008 at 04:03PM PST, ID: 23109922

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.19.2008 at 06:32PM PST, ID: 23216796

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.30.2008 at 02:28PM PST, ID: 23266731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.30.2008 at 02:30PM PST, ID: 23266744

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows 2000 Operating System
Tags: printer, scripting, windows, group policy
Sign Up Now!
Solution Provided By: scottejenkins
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_EXPERT_20070906