Solved

Printer Install Windows 7 using VBS Script

Posted on 2012-04-11
6
2,663 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
  • 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

863 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

20 Experts available now in Live!

Get 1:1 Help Now