Just looking at the code and not verifying if this is the correct way to do this....
You have "strConnectString" in there twice so that the only value that gets passed to the action part of the script is "\\servername\Boston_IT"
 
Try
 
strConnectString = "\\servername\Boston_IT2"
strResult =objWSHNetwork.AddWindowsPrinterConnection(strConnectString)
strConnectString = "\\servername\Boston_IT"
strResult =objWSHNetwork.AddWindowsPrinterConnection(strConnectString)
 
To lessen your variable confusion I would modify it further to
 
strConnectString = "\\servername\Boston_IT2"
strResult =objWSHNetwork.AddWindowsPrinterConnection(strConnectString)
strConnectString2 = "\\servername\Boston_IT"
strResult =objWSHNetwork.AddWindowsPrinterConnection(strConnectString2)
 
More stuff on scripting printers is available from Microsoft's Script Center - http://www.microsoft.com/technet/scriptcenter/default.mspx
 
_Stuart Fuller
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christine Allen
Sent: Tuesday, April 12, 2005 2:19 PM
To: '[email protected]'
Subject: [ActiveDir] VB Script and Group policy

Running Windows 2000 AD
 
I'm looking to automate the installation of printers using a vb script and group policy.  I found the script referenced below which works great for adding the printer and works great with GP.  However, I can only add one printer.  Every time I modify it to add additional printers it only adds one.
 
Set objWSHNetwork = CreateObject("WScript.Network") 'create network object
strConnectString = "\\servername\Boston_IT2"
strConnectString = "\\servername\Boston_IT"
strResult =objWSHNetwork.AddWindowsPrinterConnection(strConnectString)
 
Does anyone out there know a way of additional multiple printers with this script?  I should mention I am not a vb person.
 
Thanks

Reply via email to