Solved

VBS script stopped working

Posted on 2012-03-09
2
749 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you are a user of the discontinued Microsoft Office Accounting 2008 (MSOA) and have to move to a new computer running Windows 8, you will be unhappy to discover that it won't install.  In particular, Microsoft SQL Server 2005 Express Edition (SSE…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

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