unhandled exception from command line--requires "run as administrator"!

Jul 13, 2012 at 7:23 PM

Hi All: Just thought I'd pass along a tip if anyone runs into this.

I logged on to an SBS 2008 sp2 server using my domain admin login, and tried to run the cleanup tool from the command line and received the following error:

d:\tools\WSUS>wsus_cleanup_cl localhost f 8530Running with the following parameters:Server Name: localhostUsing SSL: fUsing Port: 8530The type initializer for 'Microsoft.UpdateServices.Internal.Constants' threw anexception.

Unhandled Exception: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.   at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly)   at System.Diagnostics.EventLog.SourceExists(String source, String machineName)   at WSUS_Cleanup_CL.Class1.Main(String[] args)The Zone of the assembly that failed was:MyComputer

I was able to run it without errors when I chose "run as administrator" when starting the command window. 

HTH