Thanks, everyone for your replies.

Alas, I do not want to change my naming scheme to be similar to PRT_MRH-01~Q-ACCT. I don't like the way it appears in AD.

I prefer the group names of Q-Acct Printer as my group name, but can add the print server name to the beginning. I want to strip off the last 8 characters of the group name, get the printer name, and add it to the printserver.

I did notice the extra spaces and had already cleaned them up. I just wanted to modify the script to work with my naming scheme.

So current:

Printers (over 100 with similar format Q-???):
Q-ACCT
Q-MIS
Q-Research

Print Server MRH-01

To account for Print Server change, AD Group Names containing computer accounts (Print Server at beginning):

MRH-01_Q-ACCT Printer
MRH-01_Q-MIS Printer

I'll try to modify, but know it is wrong. Trying to get from the right side of the name is tougher than getting from the beginning as the length changes. Maybe I will have to call the groups Printer MRH-01_Q-MIS instead.

code:
$WS = GetObject("WinNT://" + @domain + "/" + @wksta + "$$")
if @error
? @serror
else
For Each $grp In $WS.Groups
$GrpName = $grp.Name
if right($GrpName,7) = "Printer"
$printer = substr($GrpName,len ($GrpName)-8)
$printer = join(split($printer," "),"\")
AddPrinterConnection("\\" + $printer)
endif
Next
endif



[ 08. October 2003, 23:02: Message edited by: tjcarst ]