Sunday, January 6, 2008

Adding Network Printers Using a VBS Script

This script will install network printers for users that are a member of a specified security group. You can run this from the user's login script.

'http://vbsbob.blogspot.com/
Dim shellobj, netobj, username, adsobj

On Error Resume Next

Set shellobj = WScript.CreateObject("WScript.Shell")
Set netobj = WScript.CreateObject("WScript.Network")

While username = ""
username = netobj.UserName
Wend

adsPath = "WinNT://Active Directory Domain Name/" & username
Set adsobj = GetObject(adsPath)

For Each Prop IN adsobj.Groups
Select Case Prop.Name

Case "security group"
netobj.AddWindowsPrinterConnection "\\server name\printer share name"

1 comment:

Elizabeth J. Neal said...

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. renting impresoras sevilla