Все вопросы: [wmi]

212 вопросов

похожие теги: wmi-querywmi-service
4
голосов
2ответов
562 просмотров

Windows processes vs. applications

I can easily identify running processes by looping through the WMI Win32_Process elements. Is there a similar way to identify "applications" as in Task Manager? I assume that this is comparable to knowing whether the process has an open window. For example, when you exit Outlook, the OUTLOOK.E...

8
голосов
4ответов
10764 просмотров

Getting Service Tag from Dell Machine using .net?

I've got a class that pulls model information (hardware info) for a local machine code is like so: Imports System.Management Public Class clsWMI Private objOS As ManagementObjectSearcher Private objCS As ManagementObjectSearcher Private objMgmt As ManagementObject Private m_...

1
голосов
1ответов
1171 просмотров

Why are route.exe and WMI / IP Helper reporting different metrics?

When I call "route PRINT" from the command line in Windows XP I get (? characters are IP addresses I obfuscated intentionally for posting): Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.50.1 192.168.50.1...

3
голосов
1ответов
2012 просмотров

InvalidOperationException when calling methods on WMI object

Basically I am new to WMI and I can't figure out what I am missing here or how to debug this... ConnectionOptions connectOptions = new ConnectionOptions(); connectOptions.Username = user; connectOptions.Password = password; machine = "remoteMachine.com"; ManagementScope scop...

5
голосов
4ответов
3431 просмотров

What determines the order for sound devices in windows when using winmm.dll?

I am trying to use NAudio to create a multiple sound output application. We have 8 USB sound cards installed. NAudio lets me use all 8 but I can't figure out a pattern for determining which device index is which card. The cards will be hooked up to different hardware so it is important to make...

0
голосов
3ответов
1059 просмотров

how can i get get the MACaddress of all the NICs on my PC using WMI

HI all, I am trying to modify the code provided by MS try to access the the Network Adapter Configuration I am getting null pointer exception in it when i try to access the Mac Address or IPAddress property im using VC++ 2005. check for the // exception here: vtProp is returned as NULL line w...

1
голосов
1ответов
3950 просмотров

How can I programmatically detect a Window's network adapter's duplex state?

I am using WMI to detect a number of items about a network adapter's state. Among the things I need to find out are (a) speed and (b) duplex. I have been able to detect the speed of a network adapter by using WMI and the following Python code: from pycom.client import wmi dev_name = r"\DEVICE...

0
голосов
1ответов
1426 просмотров

PowerShell: how to get detailed information about a WMI event?

I'm learning PowerShell 2.0 on Windows 7. My task is simple: I want to listen for a WMI event and then display some information about it. Here is what I'm currently doing: Register-WmiEvent -class win32_ProcessStartTrace -sourceIdentifier processStart Wait-Event It seems to work. Indeed, I g...

15
голосов
3ответов
38023 просмотров

How to know the CPU and memory usage of a process with WMI?

I am using a wmi and python in order to track the behavior of the process running on my machine. from win32com.client import GetObject wmi = GetObject('winmgmts:') processes = wmi.InstancesOf('Win32_Process') for process in processes: print process.ProcessId, process.Name The Win32_Proc...

1
голосов
1ответов
798 просмотров

WMI error with a simple query in C#

I am trying to use this code on Windows 2000: foreach (Process p in Process.GetProcesses()) { if (p.MainModule.FileName.EndsWith("calc.exe")) { using (ManagementObjectSearcher mos = new ManagementObjectSearcher( "SELECT CommandLine,Executa...

0
голосов
1ответов
1314 просмотров

Windows impersonation for WMI calls via python?

I'm using PyWin32 to make WMI calls to the system in python from my django web application. My goal is to allow users to add printers to the system via a web interface. To do this, I'm using win32print.AddPrinterConnection. This works well running the development server under my user account. I ...

3
голосов
1ответов
234 просмотров

How to check if a CD-ROM is real or virtual

I am using the following WMI query to enumerate the CD/DVR drives on my machine: select * from Win32_CDROMDrive Question: Is there any way I can detect which of the drives returned are actual, physical CD/DVD drives and which are virtual (e.g. Deamon Tools, MagicDisc)?

4
голосов
1ответов
14235 просмотров

How to execute a batch file on a remote computer?

I would like to be able to run a batch file on a remote computer after a build, where the build output and batch file are living on the build machine. In other words, i want the batch file that is running on the remote computer to be located on the build server, available through a UNC path. I'...

0
голосов
1ответов
1312 просмотров

How to add new DNS zone on Windows Server 2008 using API or PowerShell?

Is there any API in Microsoft DNS Server 2008 to add new forward DNS using VBScript or PowerShell or P/Invoke or WMI? It's easy to generate plain text file and put it into \system32\dns. How to replace a number manual commands in MMC with just a script execution?

7
голосов
2ответов
9229 просмотров

How to obtain data from WMI using a C Application?

I have a pure C application that issues IOCTL calls to my adapter driver and displays info ,this is however compiled using Visual Developer Studio 5(non-managed code) ... I need to get some info however from my adapter using WMI .... My googling efforts show that i would need to write a C++ Appl...

10
голосов
4ответов
11317 просмотров

Why are WMI Queries so slow sometimes?

I am using System.Management namespace in a .Net to execute various WMI queries against a remote server. In my logs I can see that sometimes the queries take 30 or 40 seconds to complete while other times the queries complete in less than a second. When I see these slow queries, I try to connec...

9
голосов
4ответов
5580 просмотров

WMI Get All Monitors Not Returning All Monitors

I am using WMI Win32_MonitorDesktop to get all the monitors information on the system. However it only returns one. I have tried it on several computers, and they definitely have multiple monitors on them, connected and working. ManagementObjectSearcher monitorObjectSearch = new ManagementObjec...

11
голосов
13ответов
67029 просмотров

How to determine OS Platform with WMI?

I am trying to figure out if there is a location in WMI that will return the OS Architecture (i.e. 32-bit or 64-bit) that will work across "all" versions of Windows. I thought I had figured it out looking at my Win2k8 system when I found the following: Win32_OperatingSystem / OSArchitecture ...

2
голосов
1ответов
725 просмотров

Where does WCF log the stuff if wmi is enabled?

<system.serviceModel> <diagnostics wmiProviderEnabled="true"> I recently stumled across this setting in WCF, where you can enabled WMI logging. Where does it log to? and what is logged? There is no mention of that.. Pleaselet me know...

11
голосов
5ответов
3474 просмотров

What format is this time value in?

I have a WMI query that specifies time in this format '20090219000000.000000+480' Can someone tell me what format this is, and does .NET have any built-in functionality to work with it? EDIT This time value is from a sample query that I found. I don't know what time value was used to generate ...

2
голосов
2ответов
9608 просмотров

Problem with Win32_PhysicalMedia SerialNumber property

I wrote the following code to get the physical media serial number but in one of my computers it returns null instead. Does anybody know what the problem is? Thanks. var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia"); foreach( ManagementObject mo in searcher.Get() )...

1
голосов
4ответов
5420 просмотров

Win32_DiskDrive Signature property

Does anybody know what is the Signature property of the Win32_DiskDrive WMI class? Is it unique or users can change it like disk volume serial number? Thanks.

0
голосов
1ответов
2721 просмотров

How to use VB.NET to query remote server event logs?

I am working on creating a web app that will query event logs on internal servers for events using a specific ID. Since most of the servers are running Windows Server 2003, I cannot use the preferred System.Diagnostics.Eventing.Reader method that I was hoping to use. I've seen the mention of us...

1
голосов
1ответов
2740 просмотров

Can't locate Flash Player in WMI win32_product table

How come the Macromedia Flash Player isn't present in the WMI win32_product table? The Flash Player is installed on the machine where I'm executing the query. I'm trying to execute the following query: Select * From win32_product where name like '%Flash%' Is there any other way to get the ver...

3
голосов
3ответов
2787 просмотров

Use PowerShell to enumerate Linux SMB shares

I can list my own computer's shares no problem with: gwmi Win32_Share But when I try gwmi Win32_Share -computer myserver Where myserver is an HP MediaVault mv2120 running BusyBox. I get back the response: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) I...

0
голосов
1ответов
217 просмотров

Using PerformanceCounter through an ASP.NET AJAX call

In our office we have a 40" LCD mounted to the wall that runs a full screen instance of Firefox that in turn hosts a series of modules. Each of these modules is a self contained DIV with an AJAX interface (through jQuery) to the server to perform it's function. One of these modules monitors our ...

3
голосов
1ответов
3037 просмотров

Set Fan Speed on Windows in C++

I have this copied code from Example: Calling a Provider Method, it modified it now should it change CPU fan speed: #define _WIN32_DCOM #include <iostream> using namespace std; #include <comdef.h> #include <Wbemidl.h> # pragma comment(lib, "wbemuuid.lib") int main(int iArgCn...

7
голосов
3ответов
2637 просмотров

Determine 3rd Party Application Installation Directory

I have an application that is used on several hundred computers across the company that I must modify an INI file in the installation directory of the application. Users can install the application where ever they wish, and can have multiple versions of the application installed at any given time...

0
голосов
1ответов
1324 просмотров

How sure is to create a USB security key using PnPDeviveID?

I need to protect software using a USB key. Can I just query a USB drive with WMI and obtain the PnPDeviceId from Win32_DiskDrive Class, and compare it with one already hashed and hard coded in the application? How secure is this? Can the PNPDeviceID property be modified? Is hardware coded? Any o...

4
голосов
2ответов
4527 просмотров

How restrict an application to run only from a known USB flash drive?

I need an application to run only from a specific USB flash drive. I made some test with the WMI Win32_Diskdrive class and the PNPdeviceID property. It is a very good idea to enroll the application into a license server (web services) with this data, but I'm searching for a second method to reenf...