wmi

feature not supported [8004100c] when querying MSNdis_80211_Configuration using WMI on localhost

Hi, I need to (des)activate network card so that there's no wired ("secured") and wireless wifi,3g active connections at the same time. So, I need to tell apart which connexions is wireless and which is wired. I see no obvious way to do it querying the Win32_NetworkAdapter. Plus there a lot of (?)virtual(?) devices I really don't care ...

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 per second that the server is receiving; this is what the Windows 7 Performance Monitor tool will show you under the SQL Server:SQL Statistics category, Batch Requests/sec counter. If I monitor the serve...

How to GET Unique identifier of system.

I need Unique Identifier of the system. I used processid but it also not unique for all PCs. So I get serial number of CPU. I am using WMI to get serial number. // Win32_CPU var search = new ManagementObjectSearcher( "SELECT * FROM Win32_baseboard" ); var mobos = search.Get(); foreach (var m in mobos) { var serial = m["SerialNumbe...

How to delete a DNS Zone with WMI

I can create a new zone, add and delete records for that zone, all relatively easily using WMI and System.Management, but for the life of me can't figure out how to delete a zone. It doesn't appear to be a method in the WMI Documentation: http://msdn.microsoft.com/en-us/library/ms682123(VS.85).aspx Any thoughts on how to do this? Tryin...

Enable & disable devices

Hi all, I am trying to disable then enable a usb device - like you can do in device manager. I have tried using devcon.exe and it works perfectly, apart from when the device has been or is being used. Under these circumstances it will tell me that the device will be disabled after restarting the system. I don’t want the system to be res...

Change Generated C# Class Name

I am using ManagementClass.GetStronglyTypedClassCode to get a reference to CodeTypeDeclaration instance. I would like to change the generated class name and this method doesn't allow for this (as far as I can tell). I have tried to change the CodeTypeDeclaration.Name property, but this doesn't change constructor names etc, so the C# comp...

Win32_WindowsProductActivation SetProductKey with python

I am trying to use the SetProductKey method of Win32_WindowsProductActivation to set the windows xp key for a custom need of mine as per the second Microsoft vbs script here :http://support.microsoft.com/kb/328874. No matter what method i use i always get shut down. I have tried wmi: import wmi c = wmi.WMI() c.Win32_WindowsProductActiva...

Reliably get Latest Event Log Record with WQL

Hi All, I have written an application which collects windows logs from linux, via the Zenoss wmi-client package. It uses WQL to query the Event log and parses the return. My problem is trying to find the latest entry in the log. I stumbled across this which tells me to use the NumberOfRecords column in a query such as this Select ...

WMI & C# can they play together ?

Hi, I have seen the usefull that WMI can be. My question, is all WMI API enable to use with a .net language like C#, or is it only through c++ and Scripting enable? Do you know where Can I find information about. I could only find a few examples. Thank you a lot. ...

Get WMI Win32_Printer Duplex setting for PPD printer

I have a Windows printer configured using a PPD based driver. The PPD file defines Duplex as being supported and the duplex setting can be changed via the Printer's Printing Preferences (right click on the printer and choose properties). I have confirmed the setting works by printing a two page document. The problem I have is reading t...

Is it possible to query wmi remotely via php?

My initial question at http://stackoverflow.com/questions/3848707/query-wmi-remotely-with-php didn't get much of an answer. So now I am wondering if it is even possible. Searching on the web I am not able to find any example of it in action besides a weak class called easywmi/simplewmi that I found no evidence of anybody implementing i...

WMI Win32_PhysicalMedia SerialNumber

I am using WMI with C++ to get the physical disk serial number. On Windows 7 64bit, I get a string with the serial number. While when running the same application on a Windows XP 64bit machine I get a hexadecimal string with each char's values reversed. I have noticed 3 different behaviours so far: Windows 7 64bit String in correct ...

Get List of computers in Workgroup using WMI VBScript

Hi All, I need all the computers in the WORKGROUP. I tried the Dim objComputers Set objComputers = GetObject("WinNT://WORKGROUP") But it is Active Directory object. Is there any way to get the computers without WinNT://? Thanks in advance -Ganesh ...

SQL Event Notification vs. WMI

What is the preferred or best practice when creating alerts for database mirroring state changes, e.g. Event Notification, WMI, etc.? Does one have an advantage over the other, e.g. performance, etc? ...

How to list the currently logged on users when there are more than one at the same time?

Using WMI (regardless of the actual programming language), it's possible to get the currently logged on user using a query such as Select UserName from Win32_ComputerSystem. All nice and good. But what if multiple user sessions and/or Terminal Services are involved? Is it possible to list all the currently logged on users on a given sys...

How Do I Delete a DNS Domain Programmatically?

I am building a C# web app to manage our DNS servers and am using the WMI Namespace for everything. The only thing I am having trouble with is deleting DNS Domains. Here is my code: internal static bool DeleteDomainFromDns(string DnsServerName, string ContainerName, string Name) { try { string Query = "SE...

Granting remote user (non admin) the ability to enumerate services in Win32_Service in namespace cimv2 using WMI & C#

I'm creating a watch dog service that will be monitoring other services on various remote servers (all in the same domain). The user that I'm using to connect to the remote servers is not an admin. When I try to enumerate the services in the Win32_Service class, I get an access denied error. I've given the user 'Remote Enable' & 'Ena...

How to start/stop proccess on remote machine using C# ?

How to start/stop proccess on remote machine using C# ? Remote computer is runing winXP sp3 and I have administrator account there. I always get access denied error. *Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))* I am using C3 and .net 3.5. ...

DisconnectedContext MDA when calling WMI functions in single-threaded application

hi there. I write an app in C#, .NET 3.0 in VS2005 with a feature of monitoring insertion/ejection of various removable drives (USB flash disks, CD-ROMs etc.). I did not want to use WMI, since it can be sometimes ambiguous (e.g. it can spawn multiple insertion events for a single USB drive), so I simply override the WndProc of my mainfo...

Pass Credentials to WMI Call in VBScript

Hi everyone, I have VBScript inside a HTA getting the ping status from a local WMI call.. I also have a function to get the last reboot time of the remote pc.. Function GetReboot(strComputer) Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ...