A Script to Auto Detect and Map Printers

Category:
Miscellaneous
Type:
Snippets
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This is part of a login script, used to automatically map printers in an Active Directory environment. It makes use of permissions set on the printer and active directory group assignments to work properly. If you have a printer “Kappa” that only “Site B” can print to, assign the “Site B” group with the ability to print, and remove the everyone entry. By creating an active directory group called “Kappa” consisting of people that can access the above said printer, this script will automatically set this printer to be their default. As a side note, the IsMember() function works recursively, allowing for nested group memberships.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: