wmi

How do i set the dns search suffix for a network adapter in .net?

I've written a command line utility that detects which network interface is connected, and sets the staitc ip address and dns servers for it (by calling netsh). However, I can't seem to figure out how to set the dns search suffixes. netsh doesnt appear capable of doing that. How do I do that otherwise (WMI perhaps)? ...

Win32_LogicalDisk fails for floppies.

Using an idea from Bob King idea I wrote the following method. It works great on CD's, removable drives, regular drives. However for a floppy it always return "Not Available". Any ideas? public static void TestFloppy( char driveLetter ) { using( var searcher = new ManagementObjectSearcher( @"SELECT * FROM Win32_LogicalDisk WHERE ...

How do I know if Windows has just recovered from a BSOD?

From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you... How can my app know that "Windows XP has restarted because of a serious error"? ...

EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?

For my current C++ project I need to detect a unique string for every monitor that is connected and active on a large number of computers. Research has pointed to 2 options Use WMI and query the Win32_DesktopMonitor for all active monitors. Use the PNPDeviceID for unique identification of monitors. Use the EnumDisplayDevices API, and...

Detecting the number of processors

How do you detect the number of physical processors/cores in .net? ...

Querying machine specs

What are some ways that I can query the local machine's specifications (a range of things from CPU specs, OS version, graphics card specs and drivers, etc.) through a programmatic interface? We're writing a simple app in C# to test compatibility of our main app and want to have it dump out some system metrics, but I can't seem to find w...

How do you determine if an interface is a physical LAN port on a Windows PC?

I'm looking for a method to acurately determine if an interface is the physical 802.3 ethernet port on a pc in windows. Using ipconfig /all I can list all the interfaces, and when I do this on my pc several entries can be listed here including VPN, Bluetooth, Wifi and the physical ethernet interface. I'm looking for something like, "is...

WMI - Generic Failure

We have a .NET application that uses WMI to gather a wide range of information on machines throughout a network, such as reading the Win32_NTLogEvent to see if Symantec Antivirus has written anything. The queries work fine, but after repeatedly running a WMI query "Generic Failure" errors will start coming back. This happens very consi...

Why is enumerating installed MSI packages so slow ?

This is a follow up from this question. I'm using this slightly modified script to enumerate all installed MSI packages: strComputer = "." Set objWMIService = GetObject("winmgmts:" & _ "{impersonationLevel=impersonate}!\\" & _ strComputer & _ "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("SELECT * FROM W...

Recommendations for an enterprise management dashboard

Like many organizations, I don't have a single software application that I run to support the enterprise. I have many different software components that facilitate the business and these software components are deployed to multiple machines. All of these applications were built with some enterprise monitoring and management in mind. S...

End win32 process vbscript

Hi there, I've got the following code to end a process, but I still receive an error code 2 (Access Denied). strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'MSSEARCH.exe'") For each objProcess in colProc...

Change local administrator password in C#

I am looking for a way to change the password of a local user account (local Administrator) on a Windows (XP in this case) machine. I have read the CodeProject article about one way to do this, but this just doesn't seem 'clean'. I can see that this is possible to do with WMI, so that might be the answer, but I can't figure out how to ...

APIs in C# for grabbing CPU IDs and drive/volume serial

I'm aware that I can grab the CPU identifier and the volume serial number for a physical drive by querying WMI, but WMI usually takes its sweet time. What other speedier options, if any, are available to retrieve this information? Are there Win32 APIs that would accomplish this? Edit: Allow me to clarify. By CPU identifier, I'm referrin...

Why would I choose Powershell over WMI to develop management interfaces?

We are discussing development of an improved management infrastructure for our distributed system. We use COM, web services and .NET components. Since we're based on Microsoft Windows Server XP/2003, I guess, we basically have two options: Powershell cmdlets WMI classes using System.Management and WMI providers for native code (class, ...

Checking for equivalent shared folders in .net

Is there a way, within the .net framework, to check to see if two different shared folders are actually pointing to the same physical directory? Do directories in Windows have some sort of unique identifier? Google-fu is failing me. (I mean, aside from writing a temp file to one and seeing if it appears in the other) Edit: I think I'...

"Extend my Windows desktop onto this monitor." programatically

I would like to be able to do "Extend my Windows desktop onto this monitor" via code. A PowerShell script would be idea. I have googled around a far amount and WMI seems the way forward but as I have zero knowledge in WMI I thought I would try here. Hope someone can help! Cheers, Zi ...

Anyone know how to use WMI with C instead of C++ ?

I'd hate to have to relearn C++ just for this! Any libraries/URLs would be great and yes, Google didn't help much here :-( This is for an upcoming project in which my product (Java based) would provide support for Microsoft's Hyper-V virtualization platform. Unlike VMware, which provides a Web-service, the Hyper-V APIs are mere extensi...

Excel 2007 VBA and WMI - Current DOMAIN\USER

...

WMI event when machine comes online

Is there a WMI event you can subscribe to that will fire when a remote machine boots up and comes online, or goes offline? My application needs to be able to monitor machines for their availability, and ideally, I'd like something that can work via events instead of continuous polling. ...

find a Particular product present in a remote system or not

Trying to find the product is installed in remote pC or not, it takes long time to execute, is there any ways we can achieve this faster. //usage: //uninstall4("hostname", "productname", "{AC9C1263-2BA8-4863-BE18-01232375CE42}", "10.0.0.69"); public void uninstall4(string targetServer, string product,string guid , string ve...