amset

.info
.co.uk - exchange consultancy
.net - internet based solutions

Broadband - Exchange
Login Scripts - Net Admin
Outlook - Windows Mobile
Windows

Contact - Advertise

AddThis Social Bookmark Button

Login Scripts

Getting Started

Creating the Initial File

Testing

Implementation

Basic Techniques

Mapping Network Drives

Connecting Printers

Section Labels

More Advanced
Techniques

Domain Group Membership For Drive and Printer Mapping 

Recording Script Results

Location Detection

Machine Identification

Operating System Detection

Limiting the Number of Logins

Registry Changes

Redirection of Internet Explorer Favourites

Checking for Existence
of a File or Directory

Recording Script Results

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")

login.bat >%systemdrive%\login.txt

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:

date /t >%systemdrive%\login.txt
time /t >>%systemdrive%\login.txt
login.bat >>%systemdrive%\login.txt

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

date /t >>%systemdrive%\login.txt

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:

date /t >%userprofile%\login.txt
time /t >>%userprofile%\login.txt
login.bat >>%userprofile%\login.txt

Sponsored Links

Last Page Update:
30/04/2006

Back to the Top
Contact Us - Advertise on amset.info
Login Scripts Index - Home Page


Broadband - Exchange - Login Scripts - Network Admin - Outlook - Windows Mobile - Windows


© Amset IT Solutions Ltd. 1998 - 2008. All rights reserved. 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.