Below is a vbs script that will get the current logged on user. You can
also get the last logged on user from the registry at
HKLM\Software\Microsoft\Windows
NT\CurrentVersion\Winlogon\DefaultUserName. If you are clearing the last
logged on user from the logon box then this value will not be set. You
could pull that with a script also.

------------------code sample---------------------
'Prompt for computer name
ComputerName = InputBox("Enter the name of the computer you wish to
query")

'Connect to WMI on specified computer. If ComputerName prompt was
'canceled this will be local computer
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName
&""


Set UserSet = GetObject( winmgmt1 ).InstancesOf ("Win32_ComputerSystem")

for each User in UserSet
        MsgBox "The user name for the specified computer is: " &
User.UserName
Next 
---------------end---------------------------------
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken Lee
Sent: Saturday, March 13, 2004 3:26 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] any free tools to get login name of a specific PC
name or IP address?

Hi,
  I would like to enquire if there is any tools that can track who are
the
users or last login that log on to a specific computer name?
I know that somehow we can browse to \\ComputerName\C$\documents and
settings\profile to check for the userlogon but somehow some of the
PC/Servers doesn't allow me to do this which give me error message
"network
path not found" though I used IP address to browse in..
Any advise will be appreciated.
Thanks!

rgds,
ken

List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/


#############################################################################################################
This E-mail message is confidential, intended only for the named recipient(s) above 
and may contain information 
that is privileged, attorney work product or otherwise protected by applicable law. If 
you have received this 
message in error, please notify the sender at 402-346-6000 and delete this E-mail 
message. 
Thank you.
#############################################################################################################
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to