Questions tagged [get-wmiobject]

Get-WmiObject is a powershell cmdlet that allows WML queries to be run against WMI objects on the local or remote computers.

190 questions
0
votes
1 answer

If / Else statement using Get-WMIObject

I am attempting to use “Get-WMIObject”. If I run the script it outputs in a red text, not green as it should based on the if/else statement. Furthermore, after the script has run if I type $PredictFailure it shows that $PredictFailure is…
RoadGlide
  • 5
  • 3
0
votes
2 answers

Unable to delete a printer port WMI possibly due to a reference not being released?

Having issues deleting a printer port as a WMI object This param( [Parameter(Mandatory=$true)] [string] $printerName ) $printer=gwmi win32_Printer -filter "name='$printerName'" $printer.Delete() Write-Host $printer.portname $port=gwmi…
Charlie Hardy
  • 175
  • 1
  • 3
  • 14
0
votes
1 answer

PowerShell nesting issue

$remove = @('microsoft*','visual*') Get-WmiObject -Class Win32_Product -ComputerName $CompName | Where-Object { $f = $_.name -notcontains $remove $remove | Where-Object { $f.($_) } } | Format-Wide -Property Name -Column 1 I'm not sure…
0
votes
0 answers

Show internal progress of Get-WMIObject

I'm using Get-WMIObject, which can take quite a long time, depending on what exactly I want to get. Sadly this doesn't show its progress by default. Is there a way to get the actual internal progress of Get-WMIObject? (e.g. the percentage so one can…
0
votes
1 answer

Get LogonAs account value from a Service using powershell

I have a service running with a service account. I have a logged into the machine using administrator account. I want to find username using which the service is running. I tried below "Get-WmiObject Win32_Process -Filter "name='myservicename*'" |…
usr021986
  • 3,421
  • 14
  • 53
  • 64
0
votes
1 answer

powershell computer information script

I need to create a powershell script you can double-click on (64-bit computer) and it will output to a .txt file in the same location as the powershell script to generate information on: Computer name/model/serial no. C drive size/available disk…
user4512750
0
votes
1 answer

WMI - get unlocalized OS name

I need to retrieve the OS name from WMI. Is there a way to retrieve it unlocalized? At the moment, I am passing the locale US but the OS name retrieved is still in russian locale. I used the following: (Get-WmiObject -Class Win32_OperatingSystem…
michelle
  • 2,759
  • 4
  • 31
  • 46
0
votes
2 answers

PowerShell Last Time MS Office was Used

I am in a super hurry to try and find a way to query all of our Windows 7 computers on the corporate domain, and determine the last time they used Microsoft Office. We are under audit, that needs to be finished tomorrow (yep), and I want to see if…
Gemini
  • 109
  • 2
  • 15
0
votes
1 answer

Get IIS application pool WMI object for a Non-admin account

I wrote a powershell script to stop and start an IIS application pool on a windows server 2008 machine. IIS version is 7.5 I have administrator privileges on the machine and when I run it the script works fine. But when I trigger the same script…
abhilash
  • 21
  • 1
  • 4
0
votes
0 answers

Get running process' full command-line in one line string with Powershell

I'm trying to find a way to get a process' full command line in one string to detect if a java application is already running. The program allows for multiple instances, but I want to prevent opening more than one instance. The output of the command…
Narkael
  • 53
  • 1
  • 10
0
votes
1 answer

"Get-WmiObject Win32_QuickFixEngineering" returns "InstalledOn" with a future date

I want to check via PowerShell for the latest date when security updates were installed. Therefore I'd like to use something like this: Get-WmiObject Win32_QuickFixEngineering | Where-Object { $_.Description -eq "Security Update" } I tried…
cuilster
  • 123
  • 1
  • 12
0
votes
1 answer

Powershell: Get-WmiObject cannot run asJob in loop

I want to sometimes check some info from our servers in domains. In this example, I am trying to remotely get windows versions (just one server, currently without loop): $cr=Get-Credential "domain\adm_user" $computer="serverA" Invoke-Command {…
Jerry1
  • 372
  • 2
  • 6
  • 17
0
votes
2 answers

get wmiobject win32: how do I email the output

I have everything in place at least I think so. I want to email myself the output of a Get-WmiObject win32 command. example: $OS = "." (Get-WmiObject Win32_OperatingSystem).Name |Out-String $secpasswd = ConvertTo-SecureString "mypassword"…
Wchristner
  • 117
  • 1
  • 3
  • 12
0
votes
2 answers

Select a certain Windows service using WMI objects

The following PowerShell command would give me a list of all windows services: Get-WmiObject -Class Win32_Service What if I want to use this object to display one certain service only? Lets say I want to use it to display the spooler service only.…
Jeff S.
  • 49
  • 8
0
votes
0 answers

Get-WMIObject Access Denied, similar query

I am running WMI queries remotely against a Windows Server 2012 box. I have two queries that are doing the same exact thing, one is just more efficient than the other. Query 1: Get-WmiObject Win32_Processor | Select NumberOfCores, Caption,…
eltaco431
  • 740
  • 2
  • 10
  • 24