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
WMI change name property
I have a legacy application which works on Windows 7 and Windows 2003 Server but is not working on 2012 R2, Getting OS non-compatible error. When I try to capture the procmon, got to know it executing the WMI query Select Name from…

user2502157
- 9
- 1
- 7
0
votes
1 answer
Using Get-WMIobject Process to locate the path of a service and pull the version information
I need to verify the version of a service running on our systems. So I have got close but cannot seem to figure it out. I am using a Get-WmiObject process looking for the process of the service that is running. Then pull back the path of that…

Tram
- 55
- 2
- 9
0
votes
1 answer
powershell command result writing extra lines of space
I don't know why these commands resulting in extra lines, looks like 2 or 3 lines after the OS caption. How do I rid of the lines after the OS caption?
cls
(Get-WmiObject -class Win32_OperatingSystem -ComputerName server1).Caption
Get-WmiObject…

ikask
- 318
- 2
- 11
- 23
0
votes
2 answers
Powershell WMI vs CIM same object returns different properties attributes
I'm trying to convert a WMI based script to CIM, this script is able to inject an IP Address to an Hyper-V Virtual Mahine
Original Script is : http://www.ravichaganti.com/blog/?p=2766
In my case, I've converted the WMI to CIM sentences like…

Uh Trog
- 41
- 1
- 9
0
votes
1 answer
selecting from a list of results
I am retrieving the last logged on user using the script below - whilst I can get a list of the accounts, I only need to retrieve those that contain the "domain" name, and not accounts from the "local server name".
$Users = Get-WmiObject…

TOGEEK
- 711
- 4
- 15
- 34
0
votes
0 answers
Identify physical drive from drive letter
I am trying to identify the hardware that my PowerShell based benchmark is running from. I can get the Drive letter easy enough, and with Win32_Volume I can get some useful information like disk format. And with Win32_diskdrive I can get some…

Gordon
- 6,257
- 6
- 36
- 89
0
votes
1 answer
Get-WmiObject command line ADDING text to variable
This is the functioning code:
$Result1 = Get-WmiObject -Class Win32_Processor |
I would like to "ADD TEXT AS LABEL" like this:
$Result1 = "ADD TEXT AS LABEL" & Get-WmiObject -Class Win32_Processor |
Any and all suggestions greatly appreciated.
user5758156
0
votes
1 answer
Convert Get-WmiObject win32_diskdrive to array in Powershell 4
How can I convert a Get-WmiObject command to an array and add it to a combobox?
This is the command line:
Get-WmiObject -Query "select DeviceID from win32_diskdrive" | Select-Object -ExpandProperty DeviceID | ft -HideTableHeaders -AutoSize |…

Erick Batista
- 21
- 1
- 3
0
votes
1 answer
combining get-wmiobject, get-acl and get-childitem
I am trying to capture the shares on a given file server. Then getting the ACL (access control list) from a share (doing this manually atm). Then from that share, getting the get-childitem. Can someone help me consolidate this to one…

user2945461
- 23
- 1
- 3
0
votes
1 answer
Setting DNS settings on Network Adapter - Error Code 84
I using PowerShell with the WMI class Win32_NetworkAdapterConfiguration to apply static DNS settings on my wireless network adapter. However, the method failed with the error code 84. Below is the coding:
$dnsSettings = "8.8.8.8"
$wmi =…

PDGamer
- 1
- 3
0
votes
1 answer
Powershell command to command/script to check how many active users (local & domain) are currently logged in
I am looking for command/script to check how many users (local & domain) are currently logged in and have been active within the last 30 minutes so that I can decide to go for machine reboot or not.
Hopefully without Get-ADUser.
I came across two…

Kumar Sambhav Pandey
- 1,713
- 4
- 22
- 33
0
votes
3 answers
converting datetime from wmiobject to datetime
Trying to get the difference in days between to dates: Today's date. and a date/time from a wmiobject (this was taken from a post from the PendingReboot script from Hey, Scripting! blog):
$Lastreboottime = Get-WmiObject win32_operatingsystem…

TOGEEK
- 711
- 4
- 15
- 34
0
votes
0 answers
Rights needed for accessing wmi32_process.GetOwner
I am working on a PowerShell script that (among other things) gets the currently logged in user to a list of VM's, using WMI to get the owner of any explorer.exe processes.
$User = Get-WmiObject -Class win32_process -ComputerName $strVMName…
0
votes
2 answers
Is there any Faster method to do WMI query from Powershell ..?
Wrote a small script to find the number Multipaths from the windows servers using WMI query. It works well for the servers which can connect directly without any issue. But if one server is pingable but not able to reach through WMI script, it takes…

rpr
- 111
- 2
- 5
- 16
0
votes
1 answer
How to change LogFile.Directory property via WMI on a remote computer?
I was able to retrieve, using WMI, the value of LogFile.Directory for a specific IIS site located on a remote computer.
Now I need to change the LogFile.Directory property - this is a step in an automation process - but I am hitting a wall. This is…

Francesco Gallarotti
- 1,221
- 1
- 16
- 39