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
1 answer

Run batch file remotely

I have 200 laptops that I maintain - they are running a piece of software that employs SQL Replication - they all sync back to a central server - a.b.com If one of them goes bad I need to execute some stored procedures on the SQL Server to…
Myles Gray
  • 8,711
  • 7
  • 48
  • 70
1
vote
1 answer

VBScript Remote WMI Call "Error:0 'Permission denied: 'GetObject"

I am receiving the following error when trying to do a remote WMI call: Failed to parse the script. Error: Source:'Microsoft VBScript runtime error' Line 4 Char:1 Error:0 'Permission denied: 'GetObject'' If I run the following code pointing to my…
1
vote
1 answer

How to log peak commit charge for a system

Are there any classes in WMI that can help me extract the Peak Memory Commit Charge for a system? The value can be viewed in Task Manager/"Commit Charge (K)"/"Peak", however, I would like to be able to export this value programatically using .NET.
Myishmael
  • 113
  • 1
  • 5
1
vote
1 answer

WMI PrinterStatus always 0

I want to check if the printer has a paper or not, for this I use WMI to pick up the printer and use PrinterStatus, the problem is that it always returns 0 ("Unknow"), and I don't understand the reason, my code is as follows: public int…
Endika
  • 15
  • 3
1
vote
0 answers

Listening to wmi process closed events on remote windows server subscription seems to 'lag' and take a while to actually subscribe

I'm using the Microsoft.Management.Infrastructure (1.0.0) package in a .Net Framework 4.7.2 application. I'm using the CIM* classes to start a process on a remote machine and listen for when it finishes. I've included powershell as a tag as this…
Dave
  • 2,829
  • 3
  • 17
  • 44
1
vote
2 answers

How do I get the first install date of a disk drive in PowerShell?

In the Device Manager, I can view the properties of any device (disk drives included). In the Details tab, I can select the first install date: In PowerShell, I can get all disk drives by issuing: Get-CimInstance -ClassName CIM_DiskDrive The…
stackprotector
  • 10,498
  • 4
  • 35
  • 64
1
vote
0 answers

WMI ExecNotificationQuery using golang

I am using this go WMI package to monitor windows processes which are starting and stopping. I have see the example an implemented my own methods using Win32_Process and __InstanceCreationEvent and __InstanceDeletionEvent. Here is the sample for…
M. Javad Mohebbi
  • 415
  • 1
  • 3
  • 14
1
vote
1 answer

vb.net - managementeventwatcher not capturing a second instance of any process

I've got an application which is watching over executed processes on a device using a managementeventwatcher, like so... Dim wmiq As String = "SELECT TargetInstance FROM __InstanceCreationEvent WITHIN .025 WHERE TargetInstance ISA…
John
  • 755
  • 1
  • 18
  • 46
1
vote
2 answers

Converting code using wmi to code using ffmpy

I have the following code that prints out the names of USB cameras connected to my PC: import wmi c = wmi.WMI() wql = "Select * From Win32_USBControllerDevice" for item in c.query(wql): a = item.Dependent.PNPClass b =…
watersheep23
  • 339
  • 1
  • 3
  • 17
1
vote
0 answers

Mapping Enum from WMI/Win32

I am writing an application to record some hardware information of computers in our environment and I am unclear on an enum mapping from the Win32/CIM/WMI(?) API. I am getting VideoOutputTechnology from the root/wmi/wmimonitorconnectionparams class…
Stroniax
  • 718
  • 5
  • 15
1
vote
0 answers

Detect Antivirus through WMI

I have come up with a situation in which an installed antivirus is not detected by wmic or it's equivalent cmdlet. The system where I am having this issue is a windows server 2016 and the antivirus is SEP (Symantec Endpoint Protection) While doing…
Mario
  • 19
  • 4
1
vote
1 answer

Asynchronous auto-refresh using asp.net MVC 3

I've written a simple program that gathers some information from the WMI database such as the current CPU usage. I perform these operations in the homecontroller file, with an ActionResult Index function. Then I return the View and display these…
Slethron
  • 143
  • 1
  • 4
  • 11
1
vote
2 answers

How to get the type of an network adapter (Wi-Fi, Ethernet, Bluetooth) in Windows Powershell?

How to get the type of an network adapter (Wi-Fi, Ethernet, Bluetooth) in Windows Powershell? Currently I am using: get-wmiobject win32_networkadapter -filter "PhysicalAdapter = true" | select * Which gives a lot of information about about every…
Chriss
  • 5,157
  • 7
  • 41
  • 75
1
vote
1 answer

How Do I Get the Assigned Drive Letter When Mounting an ISO with WMI in C#?

This is the code that I am using to mount the ISO // With help of WMICodeCreator ManagementObject mo = new ManagementObject("root\\Microsoft\\Windows\\Storage", "MSFT_DiskImage.ImagePath='" + isoFile + "',StorageType=1", null); // Obtain…
Damien
  • 1,463
  • 1
  • 18
  • 30
1
vote
2 answers

How can I get the processor "SocketDesignation" with Get-CimInstance?

Since wmic calls are deprecated by Microsoft, how can I use Get-CimInstance to get the same information as wmic cpu get SocketDesignation?
golo
  • 41
  • 7
1 2 3
99
100