Storage News
Security News
Networking News 
FREE NEWSLETTERS
search
 

internet.commerce
Be a Commerce Partner
Online Degrees
T-Shirts
Memory
Memory Upgrades
Televisions
Shopping Carts
KVM Switches
Help Desks
Air Conditioners AC
Server Racks
Mp3 Player Reviews
Promotional Items
SEO Software
Cheap Airline Tickets

internet.com
Developer
International
Internet Lists
Internet News
Internet Resources
IT
Linux/Open Source
Personal Technology
Small Business
Windows Technology
xSP Resources
Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Convergence Takes Hold in the Enterprise
Enterprises around the world are moving to converged IP networks. In a recent global survey of senior executives, 84% view convergence as critical or important to achieving their strategic IT & business goals, compared with 45% in the previous survey. Click here.
 
RFID: A Business Revolution Providing Strategic and Competitive Advantage
RFID technology has been in use for many years, but is now finding a mass-market application in supply chain and asset management systems. Learn why it may be more cost-effective to build these elements into the network. Click here.
 
Lessons Learned from WiMax Trials
WiMAX is short for Worldwide Interoperability for Microwave Access. It is a standards-based technique for delivering high-bandwidth connectivity over extended distances. Learn more. Click here.
 
Solutions for Enhanced Applications Management (webinar)
In this webinar, hear AT&T; Vice President Rose Klimovich describe the pathway to integrated application and network performance management. Click here.
 
MPLS VPNs: What's Next (webinar)
Hosted by AT&T; Vice President, Rose Klimovich, this webinar describes how the network is becoming more intelligent and application-aware, reaching toward a dynamic, unified IT environment. Click here.
 
Gearing Up For IP Collaboration (Networking Views)
Collaboration between organizations supported by IP networking can yield substantial productivity rewards. But Andy Woodfield, Partner at PricewaterhouseCoopers' performance improvement consulting practice, points out that such collaboration needs preparation. Click here.

Products
 Nokia IP Firewalls (Nokia Corp)
 XMTS (Vyyo Inc)
 EtherTone (ANDA Networks)
 TurboDB Managed (dataweb GmbH)
 Forefront Client Security (Microsoft Corp)
 Magnum Factory Floor Networking Gear (GarrettCom, Inc)
» Enterprise IT Planet » Resources » Win Scripts

Secure File Transfer � FREE Trial! "WS_FTP Server is the perfect HIPAA compliant file-transfer solution. Its security features make WS_FTP an easy choice." � Margaret McDonald, Security Specialist

Enumerate Security Event Log for Event Code 529 (Unknown user/bad pwd)

November 17, 2004

Email Print Digg This Add to del.icio.us

Author: Shane Boudreaux
Platform: Windows
Type: Windows Script

Description:

Prompts for location for output file. Output file will contain results of Security Event Log query. The Query is for Event Code 529 which equates to Unknown User and/or Bad Password. This allows for quick determination of failed logon attempts.

PLATFORMS TESTED: Windows 2000 and XP

Scroll down to view the script.


                        ''===============================
			'' Query Security Event Log on local box
			''  Export Event Code 529 (Unknown user /bad pwd)
			''  FILENAME FORMAT = COMPUTERNAME.log
			''===============================
'' Declare Globals
Dim strScriptName
Dim strPCName
Dim strSecLogs
Dim strPath
strPath = Inputbox("Enter Path To Location to Save Log File")
strScriptName = "SecLogs"
GetPCName
SecLogs
Private Sub GetPCName()
	''  GET COMPUTER NAME
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:" _
  	  	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	Set colSettings = objWMIService.ExecQuery _
	    	("SELECT * FROM Win32_ComputerSystem")
	For Each objComputer in colSettings 
 		strPCName = objComputer.Name
	Next
End Sub
Private Sub SecLogs()
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,(Security)}!\\" & strComputer & "\root\cimv2")
	Set colLoggedEvents = objWMIService.ExecQuery("Select * from Win32_NTLogEvent Where Logfile = ''Security''")
	For Each objEvent in colLoggedEvents
	'' YOU MAY CHANGE THE EVENT CODE HERE, IF YOU''D LIKE TO SEARCH FOR ANOTHER EVENT
	If objEvent.EventCode = 529 Then
		If objEvent.Category = 2 Then
    			strSecLogs = strSecLogs & "," & objEvent.TimeWritten & "," & objEvent.Message & "," & "Host:" & strPCName & vbcrlf
		End If
		'' call WriteToFile
		WriteToFile strSecLogs, strScriptName, strPath
	End If
	Next
End Sub
			''===============================
			''  WRITE LOG TO FILE
			''  FILENAME FORMAT = COMPUTERNAME
			''===============================
Private Sub WriteToFile(strTextToWrite, strScriptName, strFilePath)
	Dim i	'' Variable for computer name
	''On Error Resume Next
	''  GET COMPUTER NAME
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:" _
  	  	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	Set colSettings = objWMIService.ExecQuery _
	    	("SELECT * FROM Win32_ComputerSystem")
	For Each objComputer in colSettings 
 		i = objComputer.Name
	Next
	''CODE TO WRITE FILE
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objFile = objFSO.CreateTextFile(strFilePath & i & ".log")
	objFile.WriteLine (strTextToWrite)
End Sub

Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as - is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Email Print Digg This Add to del.icio.us

Win Scripts Archives


JupiterWeb networks:

internet.comearthweb.comDevx.comGraphics.com

Search JupiterWeb:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterWeb

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers