Solved

Printer Install Windows 7 using VBS Script

Posted on 2012-04-11
6
2,729 Views
Last Modified: 2012-04-17
I have been using the following script to add shared network printers for users. This does not work on Windows 7 computers, it just hangs for several minutes after the user logs on, before the profile is loaded, and then, the printers dont end up being installed.

HOWEVER, I found that when I logged on as an administrator, and added the printer manually, then when I logged on as the user, it went through.  I also saw that as an Administrator, I received a prompt asking:

Do you trust the printer? and that Windows needs to download and install a software driver for the \\FNPSERVER computer to print to the printer. Proceed only if you trust the \\FNPSERVER comptuer and the network.

The server and network are the same for all devices, printers, and workstations.  It seems as the user does not have rights to automatically download and install the printer driver, like I have the option as Administrator.  How can I fix this?

The script I use is:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection “\\FNPSERVER\SHARP MX-B402-MAIN”
objNetwork.AddWindowsPrinterConnection “\\FNPSERVER\SHARP MX-B402-BACKUP”

It works fine for XP clients, and fine once I select to Install the Driver as an Administrator, then the script runs under the user. It appears to copy files to C:\Users\...{XXXXXXX....} location.  All the Windows 7 computers have UAC turned off.

Thank you.
0
Comment
Question by:fireguy1125
[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
  • 4
6 Comments
 
LVL 1

Author Comment

by:fireguy1125
ID: 37835151
Also, the script is located in:

Group Policy
User Configuration
Policies
Windows Settings
Scripts (Logon/Logoff)
Logon

However, I see there is another way to do this, that I haven't tried yet, but am reluctant to do so, since I don't know what effect this will have on all the Windows XP computers that already are setup:

Group Policy
UserConfiguration
Preferences
Control Panel Settings
Printers

Also since I am in a mixed 2003 and 2008 domain controller environment, will the above work if the user authenticates to a 2003 domain controller.

I'm hoping there is a settings somewhere in group policy that lets me trust the server that has the driver and installs it without admin credentials.
0
 
LVL 17

Expert Comment

by:Tony Massa
ID: 37835520
To use Group Policy Preferences, you need to make sure that you have the GPP client side extensions.  A script should work.  I helped a business partner migrate printers for WinXP and Win7 users, and we didn't have any issues except that he was calling the printer migration script from another script, and his problem was that he called the script from an untrusted location and the Win7 clients wouldn't run it.

Can you copy the file to the NETLOGON directory and test running the script as a "normal" user from the NETLOGON location?  \\domain.local\NETLOGON\TestPrinterScript.vbs.  Manually running is the same as a user logon script.

Make sure that you don't have "On Error Resume Next" enabled for your script.
0
 
LVL 11

Expert Comment

by:X_layer
ID: 37836546
I think that you must allow on Win7 machines non-administrators that they can install drivers.
Try to enable this in your GPO "Computer Configuration\Administrative Template\System\Driver Installation\Allow non-administrator to install drivers for these device setup classes".
0
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!

 
LVL 1

Author Comment

by:fireguy1125
ID: 37837238
I dont know the setup class for the driver, and the driver is not a signed driver.
0
 
LVL 1

Accepted Solution

by:
fireguy1125 earned 0 total points
ID: 37838649
It appears I found my solution.  I had to go into the Computer Configuration OU for these computers, and into Policies > Administrative Templates > Printers

I had to disable Point and Print Restrictions.  This appears to have resolved my issue.
0
 
LVL 1

Author Closing Comment

by:fireguy1125
ID: 37854954
Found my own resolution.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADMFILES.INI 7 50
Copy Picture from one workbook to newly created workbook 12 36
CMD VB Script: remove empty rows 12 11
Active Directory Replication 1 11
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

738 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