Questions tagged [wmi]
Windows Management Instrumentation (WMI) is an API for managing the Windows operating system on local or remote computers.
4,359
questions
0
votes
0
answers
79
views
Find running application of specified name but without any window
I have an application that starts with a regular window and includes a "hide" button. When this button is clicked, the application continues running and is visible in the Task Manager, but ...
1
vote
0
answers
56
views
How can I find parent/child relationships in USB devices with the C# ManagementObject object?
I see in Windows device manager that a USB composite device has children, such as speaker/microphone/COM port.
How can I find these relations using the ManagementObject implementation in C# .NET?
I ...
0
votes
1
answer
15
views
Win32_Services. Service retrieval through python from a remote machine
I am making a web application to monitor certain servers and part of that is monitoring specific services that should be running in those servers. I made a simple python script that tests the ...
0
votes
0
answers
14
views
IWbemServices ExecMethod fails with 0x80070005 (Access Denied) in C++
I am having a C++ Application to access WMI namespace the source code looks below,
// Create instance of IWbemLocator
IWbemLocator *pLocator = nullptr;
HRESULT hResult = CoCreateInstance(...
0
votes
0
answers
19
views
Problem with finding printer status using WMI in .NET
I am working on a project in .NET Core and need to get printer status information on my client. I am using WMI (Windows Management Instrumentation) for this task. My code looks like this:
public async ...
0
votes
1
answer
44
views
List of WMI Method Attributes
I try to access all attributes of the given method from any classes into the WMI.
For example, I can list the methods inside "Win32_SystemDriver " class
Get-WmiObject -Class ...
0
votes
0
answers
25
views
Need a WMI contrast event class similar to Brightness event WmiMonitorBrightnessEvent
Using the below code, I could able to get an event when someone changes the brightness in Windows:
public static void WindowBrightnessListener()
{
try
{
string queryString = "...
0
votes
0
answers
18
views
Get SQL Services details without administrator permissions
Unable to fetch SQL services without administrator permissions
I tried below script to fetch services
Get-Ciminstance -className win32_Service -OperationTimeoutSec 15 -ComputerName ‘xyz’
I got access ...
0
votes
1
answer
75
views
System.Runtime.InteropServices.COMException: 'The RPC server is unavailable Error
I'm trying to run a command on my other pc but I keep getting this error when i run the code.
I have enabled Domain Privilege for Windows Management Instrumentation(WMI) like this post
var hostname = ...
0
votes
1
answer
29
views
Sorting WMI ManagementObjectCollection and GetProcessesByName
I need to get information about and manipulate instances of a third-party program with the executable filename strModule for which hundreds of instances are spawned. Each instance is spawned with ...
0
votes
1
answer
23
views
See Last Login time of domain users in a local computer
Well, I have a hard task of removing users' folders who have not logged for a specific day in computers, we will be doing that in users that have not logged for more than 90 days.
I encountered the ...
1
vote
0
answers
49
views
change hostname in python
I was referring to an older stack overflow post:How do I change a computer's name with the WMI module in Python.
I tried to do the same thing, but upon doing so, I got a return of (5,). This is a ...
0
votes
0
answers
22
views
Powershell Windows Service password script not executing
Below I have a powershell script that attempts to change a windows service password on a remote under a lofin account with a partial match. So if the log on as account name is set as username1 all i ...
0
votes
0
answers
17
views
How to change the value of VideoOutputTechnology of WmiMonitorConnectionParams?
I'm querying WmiMonitorConnectionParams:
using (var searcher = new ManagementObjectSearcher(@"Root\WMI", "SELECT * FROM WmiMonitorConnectionParams"))
using (var results = searcher....
0
votes
0
answers
45
views
PS - compare WMI query for docking station version to specific value
Trying to figure out how to compare the returned value of a WMI query to a set value.
I.e.
Get-WmiObject -class HP_DockAccessory -computername $_ -namespace root/HP/InstrumentedServices/v1 | Select ...
0
votes
1
answer
25
views
How to evaluate all LogicalDisk instances in a machine excluding mapped network drives?
I am writing a method to get the physical hardware serial number of the operating system drive. I am using the call
ManagementClass("Win32_LogicalDisk").GetInstances()
to get all drive ...
0
votes
0
answers
14
views
Problems using WMI Static Configuration Methods to remote PC's
first time posting on stackoverflow!
I need to be able to change the static configuration of NICs in my Domain, so i'm using WMI to do it. I have most stuff figured and my code works great on local PC'...
0
votes
0
answers
7
views
Why is there only default program group in LogicalProgramGroup in WMI?
When I use the LogicalProgramGroup class in WMI to get groupname, name, and username in the program group, I can only get groupname, name, and username whose username is default. Cannot get other ...
0
votes
0
answers
22
views
Processor load percentage for individual processors using WMI Class Win32_PerfFormattedData_Counters_ProcessorInformation
I am using "Win32_PerfFormattedData_Counters_ProcessorInformation" WMI class to read processor information. I want to collect the load percentage for each individual processor from this WMI ...
0
votes
0
answers
71
views
Is there a way to intercept the result of a WMI query?
I have this code that make a call to WMI using a query to fecth the display information:
var success = true;
List<Display> displays = new List<Display>();
// Query ...
0
votes
0
answers
34
views
Last GPO refresh time
Which WMI class contains the information of last gpo application time in that computer? I checked RSOP_Session's CreationTime property, but it is showing some time in 2013 year (10 years old time). I ...
0
votes
0
answers
45
views
Querying UWF through WMI C++ gives wrong values
I'm trying to read UWF status through the WMI provider in my C++ application, but it doesn't seem to give me correct values. (Everything is false/zero.)
When I go through the same interface in ...
-1
votes
1
answer
30
views
Getting a PPID of a process with wmi library
I want to extract the PPID of a process by his PID, don't know how and need help
So far I was able to print all running processes for the user to choose from, and created a variable that receives a ...
0
votes
0
answers
37
views
How to monitor memory usage using Win32_PerfRawData_PerfProc_Process?
I have a windows 10 PC on the shop floor of a 24/7 manufacturing plant. The PC runs fine if its memory usage is around 25 or 30% like it is after a restart. If it gets up over about 85%, applications ...
0
votes
0
answers
16
views
What memory should I look at (WorkingSet, VirtualBytes, PrivateBytes, PoolNonpagedBytes) for memory leak [duplicate]
I have a windows 10 PC that sometimes runs low on memory per the Task Manager Performance screen. The PC is in a factory, runs 24/7 and is used by multiple, non technical users. ALSO - I DO NOT HAVE ...
0
votes
0
answers
21
views
does an other way exist to separate WMI query results than this?
Description:
My goal is to get specific result from namespace "root\ccm\policy\machine\actualconfig".
Who is involved in software distribution may have knowledge or even better some others ...
1
vote
1
answer
52
views
WMI Query an Array which has an Object embedded
I am trying to write a PowerShell Script, which queries on a local Client the SCCM WMI Tree root\ccm\ClientSDK
we want to have the info was PostInstallaction an Application is using (Yes we know ...
0
votes
0
answers
164
views
vbscript failed will error 0x80041002 on Windows 10
I’m running this vb script which is part of a larger one on multiple Windows 10 machines but for some reason it failed on a specific one.
Const HKEY_CLASSES_ROOT = &H80000000
'On Error Resume ...
0
votes
0
answers
41
views
Does Win32_PnPEntity stores device history? In other words, it always returns ONLY connected pnp entities?
Docs on Win32_PnPEntity.Present
Present
Data type: boolean
Access type: Read-only
Qualifiers: MappingStrings ("WMI")
Whether this Plug and Play device is currently in the system.
Windows ...
0
votes
0
answers
38
views
System.Management v7 (WMI) not supported in web apps
With the latest release of System.Management assembly version 7 (WMI) you cannot use the apis in Web application scenarios, a PlatformNotSupportedException is thrown with message: "is only ...
0
votes
0
answers
48
views
Win32_InstalledProgramFramework not working properly?
I'm coming in with a super complicated Question which is kind of related to PowerShell Scripting as well.
Normally, since Win7 (at least according to the Documentation) - Windows should expose this ...
-1
votes
1
answer
113
views
(WMI) IWbemServices::Release() throws "Access Denied" exception when connected to remote machine
In C++, I can't find a way to appropriately terminate a WMI session with a remote server. Any attempt to release the IWbemServices pointer throws an exception; the TCP connection to the server ...
0
votes
0
answers
40
views
SCCM Alter WSUS Maintenance features via PowerShell
Microsoft Endpoint Configuration Manager > Administration > Site Configuration > Site > (Right click site name) Configure Site Components > Software Update Point > WSUS Maintenance
...
0
votes
1
answer
110
views
How to query a running thread for its parameters list? (Windows, Rust/C++)
This is in continuation of How to query a running process for its parameters list? (Windows, C++).
I am currently using WMI to get the arguments a process was launched with, but WMI does not contain ...
0
votes
0
answers
58
views
Is it possible to implement a provider method on top of python?
I'm trying to control my laptop fan speed using WMI in python.
This is my python code:
import wmi
c = wmi.WMI ()
cim_fan = c.CIM_Fan()
fan_speed = 4000
cim_fan[0].SetSpeed(fan_speed)
But it throws ...
0
votes
2
answers
101
views
TypeError: must be real number, not c_ulonglong
I'm trying to control my laptop fan speed using WMI in python. The documentation says the input is uint64:
uint32 SetSpeed(
[in] uint64 DesiredSpeed
);
This is my python code:
import wmi
from ...
1
vote
1
answer
117
views
How to extract a substring from the result of a WMI query in batch?
I have some WMI batch queries, this one gets the computer's (mostely laptops) processor information :
rem proc. info
setlocal enableDelayedExpansion
for /f "tokens=2 delims=," %%a in ('wmic ...
0
votes
0
answers
50
views
PowerShell variable comparison (like, eq) not working as expected
I'm trying to compare two variables, which store a SHA1 hash.
One of the variables is from a WMIC command and the other is from a get-childitem command.
The WMIC command in question: (Get-WmiObject -...
0
votes
0
answers
28
views
Is it possible to retrieve latest version number of a device driver with C# alone?
I'm currently creating a program that detects the graphics card device as well as the version of the driver by using Win32_VideoController WMI class. I managed to get the name and the driver version ...
5
votes
0
answers
149
views
Why is the WMI Win32_Process CommandLine property null for only some processes of other users?
I'm using this C# code to get the Command Line parameters of a running process:
public static void GetProcessesCommandLine(string processName)
{
string query = $@"SELECT CommandLine,ProcessId ...
0
votes
0
answers
74
views
How to query SID of remote computer local user using non-domain admin account
Using the following script:
$cred = Get-Credential
Invoke-Command -ComputerName "target-win" -ScriptBlock {
function get-sid
{
Param ( $DSIdentity )
$ID = new-object System.Security....
0
votes
0
answers
101
views
Check for yellow bangs in Device Manager
I need to find the number of devices (on Windows 11) with yellow bangs.
I found this WQL query:
SELECT * FROM Win32_PnPEntity WHERE ConfigManagerErrorCode <> 0
I implemented this in Python. It ...
0
votes
0
answers
33
views
Python WMI returns empty answer for request under SheduledTask execution
I have a code which is successfully works in common situation when i run script after login
rval = 0 # Default: Check passes.
wmi_o = wmi.WMI('server')
#wmi_o = wmi.WMI('server',user='domain\...
0
votes
1
answer
103
views
WMI IWbemServices::ExecMethod is slow on Win32API
I am trying to get info for all running processes on windows. Through ExecMethod I am trying to get user name and domain of a process owner. I am doing it like this:
HRESULT hres;
BSTR MethodName ...
0
votes
0
answers
20
views
.NET C# WMI Decoupled provider cannot access files
I am writing a small decoupled WMI provider using benefits of .NET System Management Instrumentation
using System;
using System.ComponentModel;
using System.Management.Instrumentation;
[assembly: ...
0
votes
0
answers
117
views
In some cases can't get drive serial number in C# app
public static string? GetDriveSerialNumber()
{
var moSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
foreach (var o in moSearcher.Get())...
1
vote
0
answers
83
views
Python based .exe file running but not working on another machine and sometimes throwing wmi.py exception
I am trying to create an .exe file that would be called repeatedly by windows to kill a certain process in case it is running too long (it is stuck). I want it to be general, so it requires three ...
0
votes
1
answer
224
views
WMI wbemtest error 0x80070005 Access is Denied
I am trying to connect to a server remotely using wbemtest (WMI). I keep on getting error;
Number: 0x80070005
Facility: Win32
Description: Access is Denied.
I have done the following to try to clear ...
2
votes
1
answer
398
views
PowerShell script - CommandLine of a process not showing
I've been trying to create a PowerShell script which should list all running instances of svchost.exe process along with their PID, CommandLine, CPU, and RAM usage. However, I have an issue with ...
1
vote
1
answer
225
views
How does windows task manager performance tab fetches CPU GPU VPU and Memory utilization/Usage
where is the task manager is getting this data and how it is mapping to particular device.
basically i'm trying to write a script which fetches the CPU GPU VPU utilization from task manager. We have ...