Perhaps you could create a logon script that maps the printer based on the RDP connection? First create an "iplist.txt" file that contains the ip addresses and departments that you want to map the printer for:
192.168.0.173,Marketing
192.168.1.173,Sales
192.168.2.173,Finance
Place the iplist.txt file in a directory that the person logging on will have read access to. From there you can use this batch file to map the printer:
@echo off
netstat -na | find "3389" | find "ESTABLISHED" > logfile.txt
for /f "tokens=1,2 delims=," %%a in (iplist.txt) do (
for /f %%i in ('findstr %%a logfile.txt') do (
set ip_addr=%%a
)
if "%ip_addr%" == "%%a" (
if "%%b" == "Marketing" (
rundll32 printui.dll,PrintUIEntry /in /q /n \\print_server\marketing_ptr
REM Set as default:
rundll32 printui.dll,PrintUIEntry /y /q /n
goto :end )
if "%%b" == "Sales" (
rundll32 printui.dll,PrintUIEntry /in /q /n \\print_server\sales_ptr
REM Set as default:
rundll32 printui.dll,PrintUIEntry /y /q /n
goto :end )
if "%%b" == "Finance" (
rundll32 printui.dll,PrintUIEntry /in /q /n \\print_server\finance_ptr
REM Set as default:
rundll32 printui.dll,PrintUIEntry /y /q /n
goto :end ) )
)
:end
del logfile.txt
You also want to make sure that logfile.txt gets written to a location that the user logging on will have write access to.
It may not be the reg hack your looking for, but it could work as an alternative....