Install VBS printer map w/ Admin rights

Posted on 2012-09-05
Last Modified: 2012-09-11
We want to map printer using the below VB script but need to install as admin so not to prompt our users for admin rights when downloading drivers.

And of course, we don't want this visible to users (admin password).

Clients are W7/server 2003 sp2

Please advise....
We are using the below code to map network printers...want to attach it to log on script.
Problem is machines ask for admin rights.  how can we add that option to script and protect it from users seeing admin password?

Option Explicit
Dim netPrinter, UNCpath
UNCpath = "\\share\printer"
Set netPrinter = CreateObject("WScript.Network" )
netPrinter.AddWindowsPrinterConnection UNCpath
' Here is where we set the default printer
netPrinter.SetDefaultPrinter UNCpath

UNCpath = "\\share\printer"
netPrinter.AddWindowsPrinterConnection UNCpath
'Adds second printer 

Open in new window

Question by:unTech
    LVL 18

    Expert Comment

    by:Don S.
    There is a GPO setting that allows non-admin users to install printer drivers without being prompted to elevate rights.  The setting is in the User adminitrative templates, control panel/printers Point and Print Restrictions - set it to disabled.

    Author Comment

    No.  I still get prompted for admin password.  
    I updated GP on machine and printed out policy report to file to verify and Point and Print Restrictions - set it to disabled.

    I think the computer policy is still in affect.  I do not see Point and Print Restrictions (Computer Configuration -> Policies -> Administrative Templates -> Printers : Point and Print Restrictions) in 2003 server per this document:

    However, when using GPUPDATE and looking at Computer Config while pointing to Domain Controller it says that the Policy definitions (ADMX files) retrieved from local machine.

    Why cannot I edit them on domain?

    Accepted Solution

    LVL 18

    Expert Comment

    by:Don S.
    You need to do all of your windows 7 policy editing from the RSAT tools on a Windows computer.  Group policy editing on a 2003 server does not know about Windows 7 and won't have all of the items to edit - Point and Print at the computer level being one of them.

    Author Closing Comment

    This is what worked best

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
    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  ( Here (http…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now