When you use Howard's script you have to obay to the naming convention he has set for the groupnames.
Using Howard's script, a printergroup must start with the letters: PRT_
You have only one printserver now, BUT if you don't include the servername in the groupname now, You could get into
serious trouble, when you add another printserver to the domain, so a good advice is to use Howard's script as is.
To make the script work, asuming the name of the printserver is: MRH-01, you should rename the group:
Q-ACCT Printer
To:
PRT_MRH-01~Q-ACCT
And rename the group:
Q-MIS Printer
To:
PRT_MRH-01~Q-MIS
Also, You have a lot of spaces in your strings, that should not be there, ie.
" /" is not the same as "/"
AND, the one Sealeopard pointed out:
" prt_" is not the same as "prt_"
(" prt_" is five long)
After renaming the groups, you should use this (Cleaned up for spaces) script:code:
$WS = GetObject("WinNT://" + @domain + "/" + @wksta + "$$")
if @error
? @serror
else
For Each $grp In $WS.Groups
$GrpName = $grp.Name
if left($GrpName,4) = "prt_"
$printer = substr($GrpName,5)
$printer = join(split($printer,"~"),"\")
AddPrinterConnection("\\" + $printer)
endif
Next
endif
-Erik