(4, 76) Microsoft VBScript compliation error: Expected end of statement
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Grocott Lee BC GB
Sent: Tuesday, June 22, 2004 4:38 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Tracking the machine from which user logs in
I would say it's easy to get the IP information at logon using vbs and wmi:
Start of VBScript:
------------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery ("Select MACAddress, IPAddress,
ServiceName, Description, IPSubnet, DHCPEnabled, DHCPServer,
DefaultIPGateway, WINSPrimaryServer, WINSSecondaryServer from
Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig In IPConfigSet
GetNetworkCardProperties(IPConfig)
Next
Function GetNetworkCardProperties(IPConfig)
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
If IPAddress <> Ipconfig.IPAddress(i) Then
Wscript.Echo "IPAddress", IPConfig.IPAddress(i)
Wscript.Echo "MACAddress", IPConfig.MACAddress(i)
Wscript.Echo "SubNetmask", IPConfig.IPSubnet(i)
Wscript.Echo "ServiceName", IPConfig.ServiceName
Wscript.Echo "Description", IPConfig.Description
If IPConfig.DHCPEnabled < 0 Then
IPDHCPEnabled = "TRUE"
Elseif IPConfig.DHCPEnabled > 0 Then
IPDHCPEnabled = "FALSE"
End if
Wscript.Echo "DHCPEnabled", IPDHCPEnabled
Wscript.Echo "DHCPServer", IPConfig.DHCPServer
Wscript.Echo "DefaultGateway",
IPConfig.DefaultIPGateway(i)
Wscript.Echo "WINSPrimary",
IPConfig.WINSPrimaryServer
Wscript.Echo "WINSSecondary",
IPConfig.WINSSecondaryServer
End If
Next
End If
end function
------------------
End of VB Script
:-)
Does that help? Let me know if something's not clear.
Cheers,
Lee
-----Original Message-----
From: joe [mailto:[EMAIL PROTECTED]
Sent: 21 June 2004 22:31
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Tracking the machine from which user logs in
Well it depends on good you want your data to be....
However the only real full proof way of doing this is to write a service
that runs on each PC and watches what is going on. You have several
different types of logons, network, interactive, service, etc. Someone could
log onto an ID on a machine but never hit a logon script (cached cred logon
or runas, etc).
As for log offs... Well log offs are a slippery concept, if someone
hibernates, did they log off? What if they just shut the PC off?
joe
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mukul Joshi
Sent: Sunday, June 06, 2004 2:55 AM
To: ADList
Subject: [ActiveDir] Tracking the machine from which user logs in
Hi,
I am writing an application that would track the login logoff activities of
users. I can get lastlogin and lastlogoff information from AD, but I also
need to know the machine/IP on which that particular login/logoff happened.
How do I get this information?
Thanks
~ Mukul
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/
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/
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 is confidential, may contain proprietary information
of the Cooper Cameron Corporation and its operating Divisions
and may be confidential or privileged.
This e-mail should be read, copied, disseminated and/or used only
by the addressee. If you have received this message in error please
delete it, together with any attachments, from your system.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/