Solved

Problem With a Startup Script in SBS 2003 Domand

Posted on 2009-07-01
3
592 Views
Last Modified: 2012-05-07
I need to install a pair of printers on the client computers in an SBS 2003 domain.  I've implemented a GPO that appears to be running.  I see "running startup scripts.." on the client as it's starting up and a WScript.Echo Cstr in the vbs script echos on the client screen.  However, the printers aren't installed.

Using My Network Places and going to the SYSVOL\VOLGROUP.LOCAL\POLICIES\{....}\MACHINE\SCRIPTS\STARTUP\ folder and double-click on the script, the printers are installed.

Is there something obvious that I'm not doing?
'  VBScript to map two printers from \\AARP
'  One printer set to default based upon name of computer
'--------------------------------------------------------
Option Explicit
'On Error Resume Next
'
Dim objShell
Dim regComputerName, strComputerName, intNumber
Dim multiPrinter, UNCpath1, UNCpath2
'
' First get computer name
'
regComputerName = "HKLM\SYSTEM\CurrentControlSet\Control" &_
	"\ComputerName\ComputerName\ComputerName"
 
Set objShell = CreateObject( "WScript.Shell")
strComputerName = objShell.RegRead( regComputerName)
'
' Now get computer number based on last two characters of name, ie AARP02 -> 2
'
intNumber = CInt(Right(strComputerName,2))
'
' Now add printers to computer
'
UNCpath1 = "\\AARP\Kyocera1"
UNCpath2 = "\\AARP\Kyocera2"
Set multiPrinter = CreateObject("WScript.Network") 
multiPrinter.AddWindowsPrinterConnection UNCpath1
multiPrinter.AddWindowsPrinterConnection UNCpath2
'
' Now set default printer
'
If intNumber MOD 2 = 0 Then
	multiPrinter.SetDefaultPrinter "\\AARP\Kyocera2"
Else
	multiPrinter.SetDefaultPrinter "\\AARP\Kyocera1"
End If
'
'WScript.Echo Cstr( intNumber)  ' use this to test running of script
WScript.Echo Cstr( UNCpath1)  ' use this to test running of script
WScript.Quit

Open in new window

0
Comment
Question by:767WuLiMaster
[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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
tojo2k earned 500 total points
ID: 24759555
You said this is a startup script, right?  If you want the printers to show up for users, you should put that in a logon script instead.  Printer connections are attached to the user profile, and the user profile hasn't been loaded yet at the time that your script is running.  Chances are the printers have been installed to the Local System profile.
0
 

Author Comment

by:767WuLiMaster
ID: 24759813
Changing to a logon script didn't help.  Still no printers installed.  Now no evidence that the script even ran.  I see no pop-up window with the WScript.Echo text.
0
 

Author Closing Comment

by:767WuLiMaster
ID: 31599002
Cockpit error on my part implementing the logon script.  All working fine now. Tnx
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Because virtualization becomes more and more common, and, with Microsoft Hyper-V included in Windows Server at no additional costs, and, most server hardware nowadays is more than capable of running a physical Small Business Server (SBS) 2008 or 201…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

635 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