Solved

Printer Install Windows 7 using VBS Script

Posted on 2012-04-11
6
2,647 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
 
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

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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 tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

760 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

23 Experts available now in Live!

Get 1:1 Help Now