check when PC was last logged onto a network

  • Follow


Is there a way I can use VBScript to check when a particular PC was last 
logged onto a given domain (our company network)? 

Our site support staff would find this useful in getting some of our remote 
users to connect more frequently for security patches, application updates, 
etc., if there was a way to check how many days since the PC was last 
connected to the network, then display a message to the user if number of 
days not on the network is greater than X.

Thanks.
0
Reply Utf 9/21/2010 3:02:03 PM


"Tony Logan" <TonyLogan@discussions.microsoft.com> wrote in message 
news:49BD6C32-F1D6-47F5-8A4B-0333A40894B9@microsoft.com...
> Is there a way I can use VBScript to check when a particular PC was last
> logged onto a given domain (our company network)?
>
> Our site support staff would find this useful in getting some of our 
> remote
> users to connect more frequently for security patches, application 
> updates,
> etc., if there was a way to check how many days since the PC was last
> connected to the network, then display a message to the user if number of
> days not on the network is greater than X.
>
> Thanks.

I do this by getting the logon script to maintain a log file on the server 
for every user who logs on, recording the following details:
- Date, time
- User name
- Computer name
- Local or remote logon

This approach has several advantages:
- It tells you exactly who logs on where and when.
- It is controlled centrally. There is no need to launch a script locally.
- You do not need to rely on users responding to a message (they don't!). 
You will know without asking them.
- The log file is a valuable source of information when you have security 
concerns, e.g. log ons outside business hours, remote logons, logons on the 
wrong workstation. 

0
Reply Pegasus 9/21/2010 8:55:11 PM



"Pegasus [MVP]" <news@microsoft.com> wrote in message 
news:OwHZM9cWLHA.2088@TK2MSFTNGP04.phx.gbl...
>
>
> "Tony Logan" <TonyLogan@discussions.microsoft.com> wrote in message 
> news:49BD6C32-F1D6-47F5-8A4B-0333A40894B9@microsoft.com...
>> Is there a way I can use VBScript to check when a particular PC was last
>> logged onto a given domain (our company network)?
>>
>> Our site support staff would find this useful in getting some of our 
>> remote
>> users to connect more frequently for security patches, application 
>> updates,
>> etc., if there was a way to check how many days since the PC was last
>> connected to the network, then display a message to the user if number of
>> days not on the network is greater than X.
>>
>> Thanks.
>
> I do this by getting the logon script to maintain a log file on the server 
> for every user who logs on, recording the following details:
> - Date, time
> - User name
> - Computer name
> - Local or remote logon
>
> This approach has several advantages:
> - It tells you exactly who logs on where and when.
> - It is controlled centrally. There is no need to launch a script locally.
> - You do not need to rely on users responding to a message (they don't!). 
> You will know without asking them.
> - The log file is a valuable source of information when you have security 
> concerns, e.g. log ons outside business hours, remote logons, logons on 
> the wrong workstation.

I have been doing much the same for about 10 years, porting the script from 
kixtart to vbscript when we migrated from w98 to xp. Unfortunately...

If the workstations and servers on your network are not well connected, you 
might want to consider coding this so that the log file is kept on the 
nearest server.

I agree with Pegasus' last bullet about this being a valuable source of 
info. But if someone can reverse-engineer your script they might find ways 
of falsifying the data stored in the log, or even using the information  for 
their own ends.

I got around this (sort of) by running a scheduled task every hour that 
moves the log file into a folder to which users have no access.

/Al
 

0
Reply Al 9/22/2010 5:07:25 AM

2 Replies
1997 Views

(page loaded in 0.024 seconds)

10/21/2014 1:32:21 PM


Reply: