Roaming Profiles Local & Networked Printers

Posted on 2004-10-26
Medium Priority
Last Modified: 2010-04-14

 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

Question by:ehaley
LVL 18

Expert Comment

ID: 12414158
You would need to write a logon script and apply it through group policy.

Expert Comment

ID: 12414175

Expert Comment

ID: 12424135
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.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 12706997
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?

Accepted Solution

murryc earned 750 total points
ID: 12707159
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.


Author Comment

ID: 12710731
Oh Murry.. This looks good.. I should have at this before week's end.. Thanks..

Author Comment

ID: 13348547
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!

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this article, we will see two different methods to recover deleted data. The first option will be using the transaction log to identify the operation and restore it in a specified section of the transaction log. The second option is simpler and c…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question