473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Event log backup

Hi Experts,

I have tried to use the code you posted in a website to perform the Event
Log backup using vb.net.

However,when I run the code, the program prompt an error saying that
"Invalid Parameter". The program stops at

Dim outParams As ManagementBaseObject =
classInstance.InvokeMethod("BackupEventLog", inParams, Nothing).

Below is the details error message:

System.Management.ManagementException was caught
Message="Invalid parameter "
Source="System.Management"
StackTrace:
at
System.Management.ManagementException.ThrowWithExt endedInfo(ManagementStatus
errorCode)
at System.Management.ManagementObject.InvokeMethod(St ring methodName,
ManagementBaseObject inParameters, InvokeMethodOptions options)
at EventLogAutomation.Module1.BackupEventLog() in C:\Documents and
Settings\seokbee.TEKKLSVR\My Documents\Visual Studio
2005\Projects\EventLogAutomation\EventLogAutomatio n\EventLog.vb:line 167

Basically my code is as follow:

Try
Dim classInstance As New ManagementObject( _
"root\CIMV2", _

"Win32_NTEventlogFile.Name='C:\WINDOWS\system32\co nfig\AppEvent.Evt'",
Nothing)

Dim inParams As ManagementBaseObject =
classInstance.GetMethodParameters("Copy")

inParams("FileName") = "c:\sample.txt"

Dim outParams As ManagementBaseObject = _
classInstance.InvokeMethod("Copy", inParams, Nothing)

Console.WriteLine("Out parameters:")
Console.WriteLine("ReturnValue: {0}", outParams("ReturnValue"))

Catch err As ManagementException

End Try

Anyone has any idea on this issue?
Many thanks in advance.

Regards,
Seok Bee
Jun 23 '06 #1
0 1231

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database...
1
by: Fred Prose | last post by:
Has anyone explored a process whereby the Transaction Log would be backup up based upon a defined threshold, ie. 75% full? All the research against news group posts and SQL2000 literature seems to...
1
by: suslikovich | last post by:
Hi, One of our backup jobs failed this morning but nothing got written into win nt application event log. This way our MOM 2005 couldn't generate an alert on this event since mom inspetcs...
9
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
6
by: Eric Herber | last post by:
I've a question regarding db2 (V8.1) and database backups going to a storage manager like TSM for example. As I can see in the storage manager if I backup the complete database over the TSM API...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
3
by: facicad | last post by:
I would like to know if as event before delete file exist. My probleme is with FileSystemWatch, it is only Deleted event, and went I want copy for bakup my file, the file do not exist :(
7
by: Ankit Aneja | last post by:
i am using com dll in my project which fires up event code in vb is like this Option Explicit Dim WithEvents p As CLAMXLib.ClamEngine Dim mresult As ClamResult Private Sub...
6
by: sjoshi | last post by:
I have a derived class OraBackup which has a method that calls stored procedure on Oracledb to get status of backup job. Now the base class publishes an event like this: public delegate void...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.