Solved

VBS script stopped working

Posted on 2012-03-09
2
744 Views
Last Modified: 2012-06-27
I have a vbs script to copy the security event log so that I can back it up. I got the code from MS and it has been working for months, but last night it stopped. The code is:

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

Set colLogFiles = objWMIService.ExecQuery _
    ("Select * from Win32_NTEventLogFile where LogFileName='Security'")

For Each objLogfile in colLogFiles
    errBackupLog = objLogFile.BackupEventLog("c:\scripts\security.evt")
Next


When I run the script manually, I get the following error (on a command line):

C:\scripts\SecLogBackup.vbs(9, 1) (null): Cannot start a new logon session with an ID that is already in use

I suspect that a windows update changed some security permissions. Is there a way to make it work again without removing recent updates?

Thanks in advance
0
Comment
Question by:fisher_king
2 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 37703852
http://forums.iis.net/t/1168512.aspx seems to indicate that it's a conflict with KB980436.  Do you have that installed? Can you remove it and reboot, if so?
0
 

Author Closing Comment

by:fisher_king
ID: 37704282
It turns out that sharepoint and wsus weren't working either (even though all of the services were running). I removed the update and rebooted and everything appears to be working properly again. I don't understand why I started having problems last night when the update was installed in 2010. But thanks for the help.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now