Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).
Questions tagged [wmi-query]
545 questions
0
votes
1 answer
WMI query issue in PowerShell
Here is where I have started:
#Get Physical Memory
function getwmiinfo ($svr) {
gwmi -query "select * from
Win32_PhysicalMemory" -computername $svr | select [$svr], DeviceLocator
}
$Servers = get-content -path…

Brian
- 1
0
votes
1 answer
Monitor GAC changes in registry with WMI - RegistryKeyChangeEvent GACChangeNotification Not Found
I'm trying to monitor the registry for changes to the GAC using WMI. I have the following code:
WqlEventQuery query = new WqlEventQuery(@"SELECT * FROM RegistryKeyChangeEvent WHERE Hive = 'HKEY_LOCAL_MACHINE' AND…

xr280xr
- 12,621
- 7
- 81
- 125
0
votes
1 answer
WMI query for product id (Serial Number) returns wrong results
I wrote a WMI query like below about windows product id (Serial Number) but it doesn't return product ID.What is the reason?
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
…

osmania
- 19
- 3
0
votes
1 answer
how to read network computer files by wmi in python
I am using wmi module in python for network connection. I need to read all files which are present in network computer drives. So give me suggestion how can i do by using wmi module.
I have done connection by below code and now i need to read files…

Ashish Jain
- 760
- 1
- 8
- 23
0
votes
2 answers
Getting user name failed from the SID in c++?
When I have tried to get the username using below code, I have successfully get the user name:
hres = pSvc->GetObject(L"Win32_SID.SID='S-1-5-82-1036420768-1044797643-1061213386-2937092688-4282445334'", 0, NULL, &pclsObj, NULL);
But when assign the…

user2499879
- 673
- 3
- 10
- 16
0
votes
1 answer
Need to convert command in to wmi query\filter
Can anyone help me to convert below command into wmi query or get-wmiobj -filter, as it takes more time for remote servers.
Get-EventLog -ComputerName $Comp -LogName System -After (Get-Date).AddDays(-3) -ErrorAction Stop |
? { $_.EntryType…

Ritesh
- 45
- 2
- 6
0
votes
1 answer
WMI query to export the access rights of visualsvn_service to excel format
I'm using VisualSVN server 2.5.8 and enabled windows authentication.
I need to write a vbscript to use WMI query to export Access rights of the all repositories for the users to excel format.
I'm new to the vbscript and WMI.
Any sample vbscript is…

user1553605
- 1,333
- 5
- 24
- 42
0
votes
2 answers
How to get WMI object from a WMI object reference?
Similar to this question except that no answer was given with regards to the main question of getting an object from reference.
For example:
PS C:\Users\admin> Get-WmiObject -Namespace $namespace -Class $class
...
IsActive : 1
oA:…

Saher Ahwal
- 9,015
- 32
- 84
- 152
0
votes
3 answers
Setting Static IP on NICs - Powershell
I am creating a script which will run through a lot of the basic tasks when commissioning a new server. Now most servers have multiple NICs these days and I need to question the user (using the script) what NIC they want to assign the IP to.
At the…

PnP
- 3,133
- 17
- 62
- 95
0
votes
1 answer
Run many commands using PID of a single Win32Process
I create a Win32Process (cmd.exe) on a remote machine using WMI.
C:\Users\ayush_m>wmic /node:10.0.0.0 /user:ayush_m /password:pwd PROCESS CALL Create "cmd.exe"
Executing (Win32_Process)->Create()
Method execution successful.
Out Parameters:
instance…

ayush
- 14,350
- 11
- 53
- 100
0
votes
1 answer
Access WMI query results in SSIS
I have a situation whereby I want to process files in an SSIS package but only files that are new and only files that match specific filename patterns.
Is it possible to use WMI to achieve this task by somehow looping through the resulset of a WMI…

Rowan
- 463
- 3
- 8
- 20
0
votes
0 answers
Use WMI filtering to ensure a user is in a specific OU
I am currently creating a WMI filter for a GPO so that the policy is only run on users who are in a certain OU.
I found a tutorial that explains how to do this for PC's, so adapted it to users, but it's not working.
So part one of my question - does…

David Gard
- 11,225
- 36
- 115
- 227
0
votes
1 answer
WMI Win32_SoundDevice J-Interop throws Unknown name exception
I am trying to get Win32_SoundDevice and Win32_VideoControllerHardware id but getting Win32_SoundDevice instance throws Unknow Name Exception
here is my code
package com.az;
import static org.jinterop.dcom.core.JIProgId.valueOf;
import static…

AZ_
- 21,688
- 25
- 143
- 191
0
votes
1 answer
How to programmatically query if an SCCM 2012 Application is Active or Retired
We have an application that integrates with SCCM 2012 and saves custom SCCM applications to SCCM.
The problem I am having is that attempting to save one of our custom applications when the SCCM administrator has set the application to be in the…

Ben Cawley
- 1,606
- 17
- 29
0
votes
1 answer
WQL query Win32_NtLogEvent on WinRM using group by
I need a query that returns the SourceName, Logfile, EventIdentifier, Type, NumberOfEvents from Win32_NTLogEvent where NumberOfEvents is the number of events that share common SourceName, LogFile and EventIdentifier (I am not sure about Type). I…

James Bond
- 13
- 1
- 1