Get-WmiObject is a powershell cmdlet that allows WML queries to be run against WMI objects on the local or remote computers.
Questions tagged [get-wmiobject]
190 questions
0
votes
1 answer
powershell wmi-object | select
I would like to know if there is a way to add a If statement in the expression of a WMI-object | select ...
here is what I have :
Get-WmiObject -Class Win32_LogicalDisk -Filter DriveType=3 -ComputerName $ServersinFarm | Select @{Name='Server…

JP Legris
- 21
- 1
- 2
- 7
0
votes
1 answer
How can I pass Get-WMIObject Properties into a variable
I'm currently trying to find a command line that is running on a client machine and if the command line running the script is found, I need to terminate that process id. Here is what I currently have, but I'm a bit lost on what a good way to kill…

TheInfamousOne
- 175
- 1
- 4
- 17
0
votes
1 answer
Add Filter to Get-EventLog (server side), returning only newest N records
Is there any way to filter event log entries using PowerShell before retrieving them?
i.e.
Instead of:
[string[]]$IgnoredSources = 'SomeValue','SomeOtherValue'
Get-Eventlog -LogName $MyLog -ComputerName $MyComputer `
| ?{$IgnoredSources…

JohnLBevan
- 22,735
- 13
- 96
- 178
0
votes
1 answer
Pull NT user ID from powershell
get-wmiobject -class win32_computersystem -computername c73118 | format-table username
Will output something similar to:
username
--------
GHS_NTDOMAIN\amacor
Is it possible to only output the amacor part only?

Aaron
- 3,135
- 20
- 51
- 78
-1
votes
1 answer
WMI Object with another object as property
I have a below powershell wmi query and I want the vbscript equivalent query for the same.
(get-wmiobject ProcessorStatus -namespace root\wmi).PerfStates.State
ProcessorStatus WMI class contains Perfstates property which is an object of…

Arun
- 2,247
- 3
- 28
- 51
-1
votes
1 answer
Getting the disk signature as negative
import wmi
wmi_connector = wmi.WMI()
def get_win_drive_mappings_locally(drivemappings):
for physical_disk in wmi_connector.Win32_DiskDrive():
for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
…

Vishnu Imp
- 5
- 1
- 7
-1
votes
2 answers
Powershell Script to write to registry based on WMI information
I am looking to use a powershell script to WMI query the computer during post-install of the imaging sequence via MDT/SCCM. Actively there are multiple VB scripts to accomplish parts of the System Properties area (Manufacturer, Model, InstallDate,…

Ed Montgomery
- 1
- 4
-2
votes
1 answer
Powershell -lt and -gt giving opposite of expected results
In the below code, if I add a where-object, -lt & -gt are giving opposite of expected results.
I'm sure the reason is I'm stupid, but in what specific way am I messing up?
This part gives the expected results, where in my case, the single drive…

bbb0777
- 165
- 14
-2
votes
1 answer
Get-WmiObject not functioning properly in foreach loop
I am currently trying to write a script that takes a list of Computers joined to our domain, iterate through them one at a time to check if they exist in an Access DB that I created, run WMI queries on them collecting their system info, and add that…

Corey
- 3
- 4