Solved

Clearing Event Logs with WBEM WMI object

Posted on 2004-04-29
1
842 Views
Last Modified: 2007-12-19
What permissions and user rights are required.  I'm getting SWbemObject: Access denied messages while running a script with an admin account. The line in question is

objWMIService.ClearEventLog()
0
Comment
Question by:ojfahoum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Droby10 earned 250 total points
ID: 10956772
without more info to go on, my first thoughts are this:

for the security log you will need to impersonate the security role, in addition to any others you are using (ie. backup).  this isn't required for the application or system logs, but without it you will get access denied when attempting to clear the security event log.

ie.

' obtain all event logs
set alllogs=GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}").ExecQuery("select * from Win32_NTEventLogFile")
' will fail when attempting to clear secevent.

-vs-

' obtain all event logs
set alllogs=GetObject("winmgmts:{impersonationLevel=impersonate,(Security,Backup)}").ExecQuery("select * from Win32_NTEventLogFile")
' should not fail when attempting to clear secevent.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this increasingly digital world, security hacks are no longer just a threat, but a reality. As we've witnessed with Target's big identity hack 2013, Heartbleed in 2015, and now Cloudbleed, companies and their leaders need to prepare for the unthi…
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question