Solved

VBScript for deploying printer is not working for Windows Vista machines

Posted on 2007-03-26
4
848 Views
Last Modified: 2008-02-01
VBscript for deploying shared printer is not working for Windows Vista.

It was perfectly working for current machines which are running in Windows XP Professional and Windows 2000 Professional.

I use two newly purchased machines come with pre-loaded Windows Vista Business. Two machines are successfully joined domain. However, it was no printer deployed through GPO.

Any idea?
0
Comment
Question by:chekfu
  • 2
4 Comments
 
LVL 6

Expert Comment

by:gvlob
ID: 18794018
Can you show us your script?
0
 
LVL 1

Author Comment

by:chekfu
ID: 18798302
Here you go:

Option Explicit
Dim objNetwork, Printer1, Printer2, Printer3, Printer4

Printer1 = "\\server01\PRN001"
Printer2 = "\\server01\PRN002"
Printer3 = "\\server01\PRN004"
Printer4 = "\\server01\PRN005"

Set objNetwork = CreateObject("WScript.Network")

objNetwork.AddWindowsPrinterConnection Printer1
objNetwork.AddWindowsPrinterConnection Printer2
objNetwork.AddWindowsPrinterConnection Printer3
objNetwork.AddWindowsPrinterConnection Printer4
WScript.Quit
0
 
LVL 2

Accepted Solution

by:
jd2066 earned 500 total points
ID: 18806608
I did a Google search for "Vista WScript.Network" and found the following page http://www.developersdex.com/asp/message.asp?p=593&r=5431945&page=2
So it would appear then this will happen if the user logging in has Administrator Privileges . The problem being that the script runs elevated and the user's desktop with printer connections runs non-elevated so the script fails to work.
If that is your problem you can use a script on that page to workaround this or remove the Administrator Privileges from the account.
Justin
0
 
LVL 1

Author Comment

by:chekfu
ID: 18807742
I see. There is total solution. This issue is also occured to mapping drives script.

Thanks for info.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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 …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

11 Experts available now in Live!

Get 1:1 Help Now