A community member has associated this post with a similar question:
Mapping multiple printers by security group with VB

Only moderators can edit this content.

Adding printers via print server by security group using VB

jeremy smith 41 Reputation points
2021-01-17T21:40:38.53+00:00

Hello all. I'm having issues adding printer on a print server by security group via VBS script. Recently an issue came up that requires me to use this method instead of group policy. I'm still rather new to this and need guidance on how to modify my current script which does work but unfortunately it simply adds every printer listed while we want to check if the user is part of each separate printers security group. If they are member of that specific printers security group add the printer.

Option Explicit
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")

WshNetwork.AddWindowsPrinterConnection "\\testprintserver\testprinter1"
WshNetwork.AddWindowsPrinterConnection "\\testprintserver\testprinter2"
WshNetwork.AddWindowsPrinterConnection "\\testprintserver\testprinter3"
WshNetwork.AddWindowsPrinterConnection "\\testprintserver\testprinter4"
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,569 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
640 questions
0 comments No comments
{count} votes