Questions tagged [wmi]

Windows Management Instrumentation (WMI) is an API for managing the Windows operating system on local or remote computers.

4365 questions
1
vote
4 answers

Powershell - filtering WMIObject processes by more than one name

I am trying to get a list of running processes and filter by two process names - can any one tell me how to get this working? I've so far got it working and filtering out one process name: $rn = Get-WMIObject Win32_Process -computer servername ` …
Charlotte
  • 577
  • 4
  • 9
  • 12
1
vote
2 answers

WMIC MangementClass RemoteCommand - determining when it is finished? STDOUT?

I'm executing a remote CMD line command via WMIC that takes a few seconds to run. I'm currently doing Thread.Sleep(4000) before moving on...there MUST be a better way! Is there a variable or method I can use to determine if the command I issued…
coergo
  • 315
  • 2
  • 7
  • 18
1
vote
1 answer

Changing IP address in C#

I have a c# program that needs to connect to another computer via a UDP connection. In order to perform this operation, I need to temporarily change the IP address of my network card on my computer, so they can talk to one another. I can do this…
Phil Price
  • 11
  • 1
  • 2
1
vote
1 answer

WMI to get current printer job (including number of copies)

I tried to follow the example of WMI scripting (VBScript) to obtain several info from the current Windows OS, including the print job. Both are working successfully. ' My SampleCapturingPrinter.vbs ' ———————————————–‘ Option Explicit Dim…
gumuruh
  • 2,544
  • 4
  • 33
  • 56
1
vote
0 answers

Managing Disk Quotas in Powershell Remotely

I'm trying to eventually create a winform powershell tool that manages disk quotas on a Windows 2016 server from a Windows 10 client workstation. Given that Every single user has at least 2 mapped drives is there any way to query a specific user and…
takeitback
  • 102
  • 1
  • 2
  • 10
1
vote
0 answers

Python WMI Module - Get Root Class Property Values

I am trying to get specific property values stored in WMI on a remote computer. The properties I am looking for are not in one of the normal namespaces such as Win32_ComputerSystem nor Win32_DesktopMonitor. It's stored inside root\wmi…
Mattias
  • 11
  • 1
1
vote
1 answer

Get WMI class of a running process in windows powershell?

I am running a python script using "python script.py arg1 arg2 ...". I wanted to use powershell to check memory consumption of this script (process). The below command can't catch the python process. Looks like it isn't a…
1
vote
1 answer

VBScript, how to I find an owner of a given process?

I am trying to write vbs to find owner of process. Can you please help me?
Nil B
  • 195
  • 2
  • 9
1
vote
0 answers

InstanceCreationEvent class is not capturing the Redmi ( Xiaomi) devices as expected

I'm trying to block the Redmi (Xiaomi) Mobile Device when it plugs in to my windows laptop. I created a notification query using WMI to capture the Redmi (Xiaomi) device if plugs in using USB data cable. The query used is SELECT * FROM…
1
vote
0 answers

WMI Providers Not Working after Windows DCOM Server Hardening for CVE-2021-26414

We have application which was using by Customer and customer like to update authentication from our application to AD from NTLM to Kerberos. Based on this article, it may have to be done by early…
Tirumala
  • 11
  • 2
1
vote
0 answers

How to get device manager human interface device name?

i want to get human interface device name in device manager, I tried to use wmi, the execution speed is too slow, is there any other way to grab the human interface device ? like…
acs123
  • 49
  • 4
1
vote
1 answer

WMI turn off disks

I want to turn off disks (WMI). So far, I have the following code: ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2"); ObjectQuery query = new ObjectQuery("SELECT * FROM CIM_DiskDrive"); //create object searcher …
hamoub
  • 75
  • 1
  • 10
1
vote
3 answers

Logoff remote system using c++

I am looking for an API to logoff current user on remote computer. Two functions ExitWindows and InitiateSystemShutdown seem not exactly what I want. The first one doesn't accept computer name, the second one doesn't have logoff option.is it…
1
vote
0 answers

WMI Console opening and closing when running exe file created using python code and pyinstaller

I have a python file as battery_perc.pyw: import subprocess import time import pyttsx3 engine = pyttsx3.init() def say_pc(txt): engine.say(txt) engine.runAndWait() while True: say_pc(str(int(subprocess.run(["WMIC", "PATH",…
bowih
  • 105
  • 5
1
vote
1 answer

MSAcpi_ThermalZoneTemperature won't refresh

I want to read temperature sensors from my motherboard in PowerShell 5.1. Unfortunately the corresponding WMI-object won't fetch new values if I call it more than once. Even restarting PowerShell won't help. The only way to get new data is to reboot…
GuidoT
  • 280
  • 1
  • 12