Home > Windows Server Tips > > Stop logon scripts from treating servers as clients
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Stop logon scripts from treating servers as clients


Michael Corkery
05.09.2002
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This tip was submitted to the SearchWin2000 Tip Exchange by member Michael Corkery. Let other users know how useful it is by rating the tip below.


There's a simple way to stop your logon script from making unwanted changes on your NT/2000/XP servers that were designed for your clients (mapping drives and printers, making registry changes, setting policies, etc).

1. Right-click the .bat file stored in the "C:WINNTsystem32ReplExportScripts" folder on your PDC (usually called "logon.bat," but can be any name,) and select "Edit." The file opens in Notepad.

You should include the following three lines as close to the start of the file as possible - ideally just below the first "@echo off" -- before any commands are run or any of the .kix files are called:

  • REM (This breaks servers out of the logon script.)
  • @echo off

    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



  • if exist systemrootlanma256.bmp goto SERVEREND

    Then append to the very end of the file (after the normal exit command for clients) the following:

  • :serverend
  • REM (This exits the LOGON batch file if a server logs in.)
  • @echo This is a Server, aborting logon
  • exit

    How this works is simple -- on Windows NT or higher, all servers have the server graphic "lanma256.bmp" in the systemroot folder (which means that even if it's not installed on the C: partition, it will still work). The clients have the file "winnt256.bmp." Pre-NT Windows clients are OK too, as they do not have the server graphic that is the condition for breaking the script.

    As always, backup the original "logon.bat" file before making any changes, and test the new script before putting it back on the PDC to replicate. Hope this helps!

    Rate this Tip
    To rate tips, you must be a member of SearchWindowsServer.com.
    Register now to start rating these tips. Log in if you are already a member.




    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • Server Room Design - Planning, Cooling, Maintenance
    HomeTopicsBlogsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2004 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts