Roaming Profiles Local & Networked Printers


 I have 2 users that bounce back and forth between 2 buildings hence roaming profiles is enabled. In Building A they have a local (LPT1) printer available to them as their default printer. In building B they both share a networked printer. When they leave building B and return to building A their default printer is still the networked printer in building B. How can I force them to use their local printer while in building A and the networked one while in building B?

Windows XP workstations
Active Directory domain

Who is Participating?
ehaley..this batch file is better than the con2prt that is was using before.  Just set a location variable (let me know if you need help with that) then replace my locations "JVL, TYR, LGV" with yours.  You can eliminate one if you only have two locations.  Then replace my printer mappings with yours.  This script checks for your default printer then resets it after installing the network printers.

Let me know how it goes....

@echo off

if /i "%Location%"=="JVL" goto Start
if /i "%Location%"=="LGV" goto Start
if /i "%Location%"=="TYR" goto Start

:: **********************************************************************
:: *** Begin network printer mapping

echo Please wait while mapping network printers ...

:: *** Save the current default printer:
:: for /f "skip=3 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v Device 2^>NUL') do set StdPrt=%%b

:: *** From the check at the beginning, we know that %Location% is indeed JVL, LGV or TYR, so we can safely jump to the location:
goto %Location%

call :MapPrinter \\tyr-fs\TYR4550
goto end_Mapping

call :MapPrinter \\jvl-fs\JVL4550
goto end_Mapping

call :MapPrinter \\lgv-fs\LGV4550PCL

goto end_Mapping

:: **********************************************************************
:: *** Subroutine MapPrinter; %1: \\PrintServer\PrintShare
:: *** Maps printer only if not mapped already
set NetPrinter=%1
reg query "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices" | find /i "%NetPrinter%" >NUL
if errorlevel 1 con2prt /c %NetPrinter%
goto :eof
:: *** End subroutine MapPrinter
:: **********************************************************************


:: *** Restore the standard printer, if one was set before:
if not "%StdPrt%"=="" reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v Device /d "%StdPrt%" /f >NUL

:: *** End of mapping
:: **********************************************************************

echo ... done.

You would need to write a logon script and apply it through group policy.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Mike...I set a local variable on the computers so that the logon script knows what building they are in.  If they login from building A then the script sets a different default printer.  Vice versa for building B.  If you need more details I can give them.
ehaleyAuthor Commented:
Wow.. Sry I haven't gotten back to this post.. Since the issue has become more of a nussience to the two individuals effected by it, It has resurfaced.  Having looked at Murry's post it looks like you're is removing all printers and re adding them via a script and a third party program. "Con2Prt". I've never used this program before so I'm a little shy to it.. I just want exactly what you posted your question with; " The user always needs to keep their local printer as default, if they have a local printer." Any other way?
ehaleyAuthor Commented:
Oh Murry.. This looks good.. I should have at this before week's end.. Thanks..
ehaleyAuthor Commented:
We've disabled Roaming profiles on these accounts since they are more troublesome then they're worth.. Your script did work but the flakey-ness of Roaming Profiles made the whole point moot.. Thanks Murry!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.