473,407 Members | 2,312 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,407 software developers and data experts.

Reading Restored WMI Files

Im wondering if anyone has come across a way of reading EventLogs using WMI. The event logs files are restored from another server.
Below is the C# class that executes the query.
NOTE : The event logs were created on a different (production) machine that I dont have access to. Is it possible to read these files viia WMI ?


ManagementObjectSearcher searcher = null;
//Maybe add the namespace as a parameter in the future
string sNameSpace = "root\\cimv2";

EventList foundentries = new EventList();

System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\\\" + sMachineName + "\\" + sNameSpace);

// Although connection information is not used in this example, I'll show you how to construct it here
//Connection credentials to the remote computer - not needed if the logged in account has access
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = sUserName;
oConn.Password = sPassword;
oConn.Impersonation = ImpersonationLevel.Impersonate;
oMs.Connect();
searcher = new ManagementObjectSearcher(sWMIQuery);
searcher.Get();
searcher.Scope = oMs;


int counter = 0;

//returns the records
foreach (ManagementObject Event in searcher.Get())
{
Sep 12 '07 #1
1 1388
bartonc
6,596 Expert 4TB
I'm actually a python guy, myself, but I've recently found Scriptomatic 2.0 in order to try to get a handle on WMI.

Of course, there is always our .NET Forum where there are (no doubt) plenty of experts fielding C# quesstions.
Sep 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jol | last post by:
This is more of a fyi than a question. After restoring a live db backup to our development server there was an identically named login Melb02 on both the db server and in the restored db backup....
2
by: Burkhard Schultheis | last post by:
We have some problems with DB2 V8 on Linux. DB2 showed SQL 1042. So we restored the last online backup successfully. But because there are only 2 log files rollforward is not possible. Is it...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
2
by: Raymond Du | last post by:
Hi, I am working on a VB.Net window application, the application use System.IO.File.Delete method to delete files, can those deleted files be restored? TIA
2
by: nnimod | last post by:
Hi. I'm having trouble reading some unicode files. Basically, I have to parse certain files. Some of those files are being input in Japanese, Chinese etc. The easiest way, I figured, to distinguish...
0
by: Parv | last post by:
hi all can i attach a read only restored database. I restored a database Test in Stand by Mode. After that i detached that database and while restoring i m getting msg "Cannot attach a database...
1
by: Roy | last post by:
Hi, Thanks for helping.I have an A2K Appl.Recently,one of the groups agreed to provide data which I download into the access table.The problem is this data which is sent in a text file.I am unable...
1
by: Query Builder | last post by:
Hi All, I have to a few backups restored from a set of backup files. The backup files have been removed from the drive because of some storage constrains... For some data comparison reasons,...
0
by: Miaaa Mukherjee | last post by:
Friends , I have a one folder named FY07 which contains a zip file of 33,408KB. In that zip file it contains a .BAK file type of size 153,507,328 of 78% Ratio. Now, my problem is...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.