Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printer Install Windows 7 using VBS Script

Posted on 2012-04-11
6
Medium Priority
?
2,847 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Suggested Courses

610 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