?
Solved

Roaming Profiles Local & Networked Printers

Posted on 2004-10-26
7
Medium Priority
?
530 Views
Last Modified: 2010-04-14
Hello,

 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

Thanks,
-Mike-
0
Comment
Question by:ehaley
7 Comments
 
LVL 18

Expert Comment

by:luv2smile
ID: 12414158
You would need to write a logon script and apply it through group policy.
0
 
LVL 9

Expert Comment

by:BigC666
ID: 12414175
0
 

Expert Comment

by:murryc
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.
0
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.

 
LVL 1

Author Comment

by:ehaley
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?
0
 

Accepted Solution

by:
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....

CLS
@echo off
setlocal

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

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

CLS
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%

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

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

:LGV
call :MapPrinter \\lgv-fs\LGV4550PCL

goto end_Mapping

:: **********************************************************************
:: *** Subroutine MapPrinter; %1: \\PrintServer\PrintShare
:: *** Maps printer only if not mapped already
:MapPrinter
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
:: **********************************************************************

:end_Mapping

:: *** 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.
echo ... done.
:leave

0
 
LVL 1

Author Comment

by:ehaley
ID: 12710731
Oh Murry.. This looks good.. I should have at this before week's end.. Thanks..
-Mike-
0
 
LVL 1

Author Comment

by:ehaley
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!
0

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