Logon Script to Send Email Notifications (Page 1 of 4 )
A member of the ASP Free Forums recently asked if there was any way to receive email notification whenever users logged on across the network. I responded that there was. Today I’m going to show you how to create a network logon script that will send an email notification whenever a user logs on.As I approached this scenario, I immediately saw two ways of accomplishing this task. I could simply monitor Active Directory for user logon events, but that would require that Active Directory actually be in use. So, in an effort to make a single solution, I settled upon the second idea.
The idea was to create a logon script. Since logon scripts are loaded every time a user logs on, it works even when Active Directory is not in use. I also wanted this script to have the ability to run as a network logon script or as a standalone script for non-networked workstations. Thus, I had to rely on common objects without assuming any server capabilities.
The script’s functionality was simple. It needed to log information about the logon event, including user name, machine information, and date/time. Then it needed to create and send an email containing that information to a given address.
Of course, the script should function quietly in the background and require no user interaction.
With these goals in mind, I set out to create the script. The first order of business was to get all of the required information to create the email.
Let’s start there.
Next: Gathering logon details >>
More Windows Scripting Articles
More By Nilpo