Harry,

Welcome to KORG. When posting your code, put "code tags" around it to preserve the formatting. Edit your original post to see how it's done.

Most likely, the user is a member of PRT01 group. In a Case statement, the first condition to satisfy the test will be performed. If users are potentially members of multiple groups, you will need to define a priority scheme of some kind, save the printers (possibly in an array) and then set the default based on the highest priority.

Our login script handles this through different mechanisms, such as
- a table of per-user or per-computer DefaultPrinter settings
- a local DEFAULTPRINTER environment variable, again by user or machine
- PRIORITY values in the resource table
- SetDefault parameter for each resource

While processing, a "DefaultEligible" flag is set, and then logic is applied to find the best selection for the default printer based on all printers that have the DefaultEligible flag set.

You can review the user guide for the script on our web site (see my sig) to get some ideas for your script, or download our script to try. It's free to use in environments with 4 or fewer domain controllers.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D