Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to configure Event Viewer

Status
Not open for further replies.

JimHolland

Programmer
Feb 5, 2003
6
0
0
GB
I am trying to configure the "When maximum log size is reached:" and the "Overwrite events as needed" options within eventvwr on W2K.

Would anyone be able to help me out at all?

Many thanks for any help.
Jim.
 
This should work but I can't actually get it to write the values even though they are read/write properties?????

Set wbemServices = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Security)}!\\.\root\cimv2")

Set wbemObjectSet = wbemServices.ExecQuery("Select * from Win32_NTEventlogFile")
For Each wbemObject In wbemObjectSet
wbemObject.MaxFileSize = 5555555
wbemObject.OverWriteOutDated = 0
Next

Let me know if it works for you and maybe someone can give me a clue as to why it does not work for me (I am member of PCs Local Admin group)

Thanks,
Sunny
 
i just had a look with regmon and

"Overwrite events as needed"

is
this key
HKLM\SYSTEM\CurrentControlSet\Services\EventLog\System\Retention

set to

0x0

max log size is
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\system\MaxSize

with the size value of bytes in hex
===============
Security Forums
 
Fantastic - thankyou very much for your help.

Jim.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top