Questions tagged [wmi-query]

Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).

545 questions
3
votes
2 answers

Access SQL - WMI Namespaces from Remote Machine

i am playing with Powershell and SQL WMI events and i am wondering if i can do this stuff remotely from the admin notebook: I'd like to query the "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER" namespace: On SQLServer directly: get-wmiobject…
icnivad
  • 2,231
  • 8
  • 29
  • 35
3
votes
1 answer

How to find number of partition of a virtual hard disk through script?

I am trying to find the number of partitions on a VHD of Hyper-V 2012 through a script. Currently I am doing this using a VBScript and a PowerShell script. For this I am first using a WMI query to find out the disk number (of the VHD) in the…
Kanvas
  • 165
  • 2
  • 7
  • 23
3
votes
1 answer

IN operator in WQL

I need to write a WMI query where I need to check that some value is equal to one of the values in the list, but I didn't find that WQL supports IN operator like SQL. For example: SELECT * FROM Device WHERE __CLASS IN ("Device1", "Device20"). What…
user2060111
3
votes
4 answers

What are some common WMI queries

I'm building a C# monitor app which uses WMI to grab some performance details of a remote computer. What are some good WMI queries to grab helpful stats such as CPU load, RAM usage, HDD free space, etc. For example, you can get the CPU load from…
mike
  • 3,146
  • 5
  • 32
  • 46
3
votes
2 answers

Determine Users Accessing a Shared Folder Using PowerShell

I need to determine the users/sessions accessing a shared folder on a Windows XP (SP2) machine using a PowerShell script (v 1.0). This is the information displayed using Computer Management | System Tools | Shared Folders | Sessions. Can anyone…
Tangiest
  • 43,737
  • 24
  • 82
  • 113
3
votes
1 answer

System.Management resources monitor for statistics info such as I/O, CPU, Memory usage... etc'

I am trying to do some benchmarks on local database management systems. I need to come up with a GUI that will show information like cpu usage of each core memory usage HDD I/O ..etc It will be without the use of Vb.net but i can use p/invoke…
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
3
votes
1 answer

When Use WIN32_TempretureProbe My Retrieved value is Null?

I'm using wmi objecrs in c# language.How can I get CPU Temp ? My Code : My Select query return null value and foreach is not working because my searcher object is null. try { ManagementObjectSearcher searcher = …
3
votes
1 answer

Does WMI query allow group by?

I have a WMI query on Win32_Processor. When I test the query on a server that has 2 processors with 4 cores each it returns the same information for each core. Does WMI query allows group by, lets say, Win32_Processor.Caption when I send the query?
alinm24
  • 33
  • 3
3
votes
1 answer

WMI Win32_Directory fail in For-loop with error 800706BE The remote procedure call failed

I search before ask and not find anything applicable to my code. Also what I tried is commented in the code. The error 800706BE (The remote procedure call failed) appear in For..Next loop and each time break the cycle at varied random amount of…
Panayot Karabakalov
  • 3,109
  • 3
  • 19
  • 28
3
votes
1 answer

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.…
user177101
3
votes
1 answer

Searching for a File on Remote Machine WMI C#

I want to search for a file on remote machine. I don't know the EXACT file path but I know its under C:\Windows\System My query is something like this in WMI string querystr = "SELECT * FROM CIM_DataFile Where…
Frank Q.
  • 6,001
  • 11
  • 47
  • 62
3
votes
1 answer

Where do ManagementObjectSearcher query values come from? (WMI)

In trying to find a set of computers on a network, I discovered the ManagementObjectSearcher class along with the ManagementObject class. The constructor for ManagementObjectSearcher takes a sql/sql-esque query as a parameter. Currently, I'm using…
Zach
  • 2,537
  • 2
  • 17
  • 17
3
votes
1 answer

DVD or CD Player?

I want to know if my player is a DVD or CD Player, etc ... I tried : SELECT Drive, MediaType, Caption FROM Win32_CDROMDrive MediaType doesn't work on XP, and not very well on Seven. I tried on a computer (with Windows 7) with 1 player (Cd…
Kariboo
  • 45
  • 10
2
votes
1 answer

few very odd Performance counter using WMI or System.Diagnostics class

I want to get few performance counter using WMI query/System.Diagnostics class(C#.net). 1> Cache Total Hit Ratio   2> Cache Total Turnover Rate   3> Cache Total Entries   4> Web Service - Current Connections   5> Web Service - Connections Attempts…
amit patel
  • 2,287
  • 8
  • 31
  • 45
2
votes
3 answers

Trouble with WMI filter

I've got a notepad.exe started in my session : gwmi -Query "Select CommandLine from Win32_Process where CommandLine='C:\Windows\system32\notepad.exe'" gives Get-WmiObject : Demande non valide Au niveau de ligne : 1 Caractère : 5 + gwmi <<<< -Query…
JPBlanc
  • 70,406
  • 17
  • 130
  • 175