Jump to content

How to clear Event viewer with admin rights?


erloyaamit
 Share

Recommended Posts

I want 2 clear event logs of domain machines with domain user (Restricted user) logged in.

I m using _EventLog__Clear to clear logs. but this command runs with Admin rights. As domain user doesn't have right

to clear Application, Security etc. logs.

Is there any way so that i can use _EventLog__Clear to run with Admin rights. like runas command.

Any help would be greatly appreciated.

Link to comment
Share on other sites

Use #RequireAdmin at the beginning of your script.

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...