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
Hi Glenn,
thanks for you fast answer and sorry for the quotes. I'll do better next time. 
Your example of multiple groups is right, but we only use it in a very simple way.
Users tell us which printer they'd like to have as default and I put/move their account in the according group.
Using your or my way - the ingroup command is the same and it doesn't work.
I only find postings according to Windows 2k Domains.
Thanks again for the info on my %shell% command. I'll change that soon 
Harry