loginscripts.info
from Sembee Ltd.
UK MS Exchange Consultants
 

Page Last Updated: 21/02/2010
Recording Script Results

This information was originally on our community
site amset.info, and you may have been
redirected to this site by following a link to a URL
on that domain. This is the same information, from
the same source, just in a new location.

It is often useful to see whether a login script has run correctly. Not only is this useful for troubleshooting while testing a new script, once the script is live it allows you or other IT personnel to verify that the script ran correctly.

Create a login script batch file (for example called login2.bat) with the following line
(presuming your main login script is called "login.bat")

What this does is call your main login script so that it runs as normal. However it also uses the "systemdrive" variable from Windows (usually C:\) to find a path and and then creates a txt file with the results of the login script. A new file is created each time.

In User Manager you enter the name of the login script with this single line ("login2.bat") and not your main script. Copy both scripts to the Netlogon share.

You can also append the date and time to the results file. Change the "login2.bat" file to something like this:

If you want to record a complete log of all logins (rather than replacing the file each time) on the local machine, then change the first line of the above script to

The file will never be overwritten, just new text appended to it.

Using this method also has the advantage that if you have to change the name of your machine login script for any reason, you only need to change it in one place - and not have to change the properties of every user.

If you are using this in a Citrix or Terminal Server environment, or a machine that has multiple users then you should change the path the login script information is logged to. Otherwise you will not be able to diagnose who was writing to the script when using it as a troubleshooting tool. The most convenient location will be "%userprofile%", making the script look like this instead:


About this site

This information originally started life as a page on amset.info, our community assistance site. However that site is targeted at Microsoft Exchange server, as Sembee Ltd. is a Microsoft Exchange consultancy. Therefore it was moved to its own domain in early 2010. Traffic from amset.info is directed here.

Other sites that are owned and operated by Sembee Ltd include kbsearch.info, certificatesforexchange.com, dosprompt.info, office-recovery.info, wuauclt.info, blog.sembee.co.uk, exbpa.com and amset.info.


More Content from Sembee Ltd.
 
Resources on amset.info Other Sites Sembee Ltd.
Microsoft Exchange Command Prompt Getting Started Guide Microsoft Exchange Consultancy
Microsoft Outlook Login Scripts Director's Blog
Network Administration MS Exchange Resources  
Internet Explorer Knowledge Base search  
Microsoft Windows Recovery of MS Office content from Temp Files  
Microsoft Windows Mobile Troubleshoot the Automatic Updates Client  
Amazon Store UK ISP Status Pages  

© Sembee Ltd. 1998 - 2010.

Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions. All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned on this site. This site is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.