tagged [wmi]
Which approach is better to read Windows Event log in C#? WMI or EventLog
Which approach is better to read Windows Event log in C#? WMI or EventLog I need to write an application to grab event log for System/Applications. The other requirement is that I need to read event l...
How to remotely control a Windows Service with ServiceController?
How to remotely control a Windows Service with ServiceController? I'm trying to control Windows Services that are installed in a remote computer. I'm using the `ServiceController` class. I have this: ...
- Modified
- 16 May at 15:48
rename computer programmatically c# .net
rename computer programmatically c# .net I need to rename my computer via .net application. I have tried this code: ``` public static bool SetMachineName(string newName) { MessageBox.Show(String.For...
How do I get total physical memory size using PowerShell without WMI?
How do I get total physical memory size using PowerShell without WMI? I'm trying to get the physical memory size using PowerShell, but without using get-wmiobject. I have been using the following PS c...
- Modified
- 29 Oct at 02:16
How can I get the CPU temperature?
How can I get the CPU temperature? I need to gather some system information for the application I'm developing. The memory available and the CPU load are easy to get using C#. Unfortunately, the CPU t...
How to check if DNS server is set to 'obtain automatically'
How to check if DNS server is set to 'obtain automatically' When I get my servers DNS settings using the DNSServerSearchOrder property of my network card's settings, it returns the DNS server that it ...
Getting Windows serial number (was: Getting MachineGuid from Registry)
Getting Windows serial number (was: Getting MachineGuid from Registry) I am trying to fetch `MachineGuid` from the registry, to create some level of binding with the OS for my license system. From the...
- Modified
- 8 Jan at 11:31
How to determine Windows.Diagnostics.Process from ServiceController
How to determine Windows.Diagnostics.Process from ServiceController This is my first post, so let me start by saying HELLO! I am writing a windows service to monitor the running state of a number of o...
- Modified
- 15 Oct at 18:25
WMI to reboot remote machine
WMI to reboot remote machine I found this code on an old thread to shutdown the local machine: ``` using System.Management; void Shutdown() { ManagementBaseObject mboShutdown = null; ManagementCla...
How to connect to a remote Windows machine to execute commands using python?
How to connect to a remote Windows machine to execute commands using python? I am new to Python and I am trying to make a script that connects to a remote windows machine and execute commands there an...
- Modified
- 12 Jul at 09:18
Remote WMI query slow
Remote WMI query slow I'm working on a program that queries three different servers in order to get CPU and LogicalDisk information. Each server I query returns me values in 6 to 15 seconds (depending...
Monitoring batch requests per second on SQL Server through WMI
Monitoring batch requests per second on SQL Server through WMI I need to programmatically (.NET 3.5, C#) monitor a SQL Server 2008 machine through WMI. I want to measure the number of batch requests p...
- Modified
- 29 Sep at 11:58
How to check if windows user has a password set?
How to check if windows user has a password set? I didn't know it would be this difficult to figure out but here I am. I'm developing a net support client which has to detect if the current logged in ...
Finding information about all serial devices connected through USB in C#
Finding information about all serial devices connected through USB in C# My project requires detection of a specific device when it is connected to USB. The only way I can identify this device is by i...
- Modified
- 8 Oct at 17:21
How to identify what device was plugged into the USB slot?
How to identify what device was plugged into the USB slot? I want to detect when the user plugs in or removes a USB sound card. I've managed to actually catch the event when this happens, but I can't ...
- Modified
- 23 May at 11:48
C# Get working directory of another process
C# Get working directory of another process I want to determine the absolute path of files used by a known process by reading the command line. Currently, the process is started with relative paths in...
- Modified
- 1 Feb at 22:31
High Performance Event Log
High Performance Event Log So I've been trying various ways to get Event Log data in bulk (1000+ records/second). I need something that can filter out old logs, right now I store the last recorded eve...
Network Authentication when running exe from WMI
Network Authentication when running exe from WMI I have a C# exe that needs to be run using WMI and access a network share. However, when I access the share I get an UnauthorizedAccessException. If I ...
- Modified
- 17 May at 03:21
Check for Third Party Firewalls on a Machine
Check for Third Party Firewalls on a Machine I am working on doing a check for Firewalls. The following code quite easily checks the status of the default Windows Firewall: ``` INetFwMgr manager = Get...
- Modified
- 23 May at 12:23
WMI, negative CPU usage value and Timestamp_Sys100NS in past
WMI, negative CPU usage value and Timestamp_Sys100NS in past I am monitoring some machines using WMI, using .NET's `System.Management` stuff. The query I am using is this: From that I compute the CPU ...
Find USB drive letter from VID/PID (Needed for XP and higher)
Find USB drive letter from VID/PID (Needed for XP and higher) So I thought I would include the final answer here so you don't have to make sense of this post. Big thanks to Simon Mourier for taking th...
Using clause fails to call Dispose?
Using clause fails to call Dispose? I'm using Visual Studio 2010 to target .NET 4.0 Client Profile. I have a C# class to detect when a given process starts/terminates. For this the class uses a Manage...