I've been messing with modifying the syntax on the script from Howard below, but can't seem to get it right - I keep getting "The network path not found" errors. Any assistance is greatly appreciated.
What I have in my AD environment is the following:
Printers (over 100 with similar format Q-???):
Q-ACCT
Q-MIS
Q-Research
Print Server: (only one PS in environment now - so not reflected in group names in AD)
MRH-01
AD Group Names containing computer accounts:
Q-ACCT Printer
Q-MIS Printer
Howard's script:
----------------------------
You will need to create a group for each printer you want to map.
For example, if your printer is named " laserjet1" on the server named " server1" then create a group called " prt_server1~laserjet1" . Place the computers that should map this printer into the group.
code:
$usr = GetObject(" WinNT://" + @domain + " /" + @wksta + " $$" )
if @error <> 0
? @serror
else
For Each $grp In $usr.Groups
$GrpName = $grp.Name
if left($GrpName, 4) = " prt_"
$printer = substr($GrpName, 5)
$printer = join(split($printer," ~" )," \" )
AddPrinterConnection(" \\" + $printer)
endif
Next
endif
----------------