Hot answers tagged

10 votes

How to use WMIC to connect to remote machine and output OS information to a file?

os get vendor - there is no such thing as an OS vendor, that's where the invalid query is coming from. See the available properties - there's a Version, but no Vendor: C:\>wmic os get /? Property ...
8 votes
Accepted

DFSR-related WMI info is missing

Problem solved. DFSR was in fact not healthy. It was not a WMI problem. The server had experienced a dirty shutdown, and DFSR stopped replicating because of it. Restarting replication on the affected ...
  • 55k
6 votes

List ALL Printers using Powershell

get-shared printers Get-Printer -ComputerName pc| where Shared -eq $true | fl Name get not shared printers Get-Printer -ComputerName pc | where Shared -eq $false | fl Name get mapped printers ...
5 votes
Accepted

Win32_OperatingSystem.FreePhysicalMemory and $_.TotalVisibleMemory giving output in wrong units

According to Win32_OperatingSystem class on MSDN: TotalVisibleMemorySize Data type: uint64 Access type: Read-only Total amount, in kilobytes, of physical memory available to the operating ...
4 votes

Using SCCM and WMI to retrieve Font information

I've done something similar, but with Altiris rather than SCCM. (I imagine you could also run it through Group Policy.) Not using WMI, but just scripting. What I would have done: Create a network ...
4 votes
Accepted

How is the computer chassis type assigned

From the System Management BIOS (SMBIOS) Reference Specification at www.dmtf.org: ...the System Management BIOS Reference Specification addresses how motherboard and system vendors present ...
4 votes

Firewall Blocking PSWindowsUpdate

A new firewall rule needs to be created to allow the subsequently negotiated dynamic RPC port through. Ref: martbasi on Jan 13, 2015 at https://i1.gallery.technet.s-msft.com/2d191bcd-3308-4edd-9de2-...
4 votes
Accepted

Get installed programs via cmd or powershell

The WMI class Win32_Product uses the MSI provider to collect installed program data. This means you're only going to get data on software/packages installed using MSI. Further, calling this class ...
  • 2,387
4 votes
Accepted

WMI query ran in a Powershell console yields less results in 32 bits mode than 64 bits mode

Adopted JPBlanc's solution from this answer at StackOverflow # Setup the context information $mContext = New-Object System.Management.ManagementNamedValueCollection $mContext.Add( "...
  • 1,524
4 votes
Accepted

WMI queries can't run with a FQDN?

This is a security measure, in place to deter attacks that rely on pointing remote service names back to the loopback address (127.0.0.1) for further exploitation. You can allow certain FQDNs to ...
3 votes

I am getting Invalid class errors for my PowerShell script

Get-WmiObject : Invalid class “Msvm_ImageManagementService” This class is exposed by the Hyper-V WMI provider. If you don't have Hyper-V or Hyper-V Management tools installed on the target machine, ...
3 votes

Use WMI to remove a page file

Although not recommended by some, if you would like to disable pagefiles completely, be sure to disable Automatic page management as well: # Disable automatic pagefile management $cs = gwmi ...
  • 6,111
3 votes

Identify Windows 2012 Server core

I would use Win32_ServerFeature, it is a much smaller class and only contains the roles installed on the server. Queries using Win32_Server feature should return much quicker. Get-WmiObject -Query "...
  • 31
3 votes

Using SCCM and WMI to retrieve Font information

You can use the Win32_FontInfoAction class to retrieve information on installed fonts that have been registered at the same time that the associated software element was installed. I highlighted that ...
  • 5,531
3 votes
Accepted

Can I find the path to a DCOM application executable with WMI or Powershell?

Using the Win32_ClassicCOMClassSetting class with Powershell Get-WMIObject Win32_ClassicCOMClassSetting -Filter "AppID='{1CECFD4D-2CFB-4626-95C7-0266C26960FA}'" | select -ExpandProperty ...
  • 844
3 votes

WMI Issue - The paging file is too small for this operation to complete

I suspect your WMI files have been corrupted, try running winmgmt /verifyrepository or WMIdiag http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=7684 If these show errors ...
  • 23.9k
3 votes

WMI permissions for changing local IP without elevated privileges

Try making him or her a member of the local group: 'Network Configuration Operators'.
  • 5,641
3 votes
Accepted

WMIC - "os - Alias not found"

Your WMI database seems to be broken, you need to follow this guide: https://msdn.microsoft.com/en-us/library/aa394603(v=vs.85).aspx to run WMI Diagnosis Utility, which will help you to confirm if ...
  • 3,597
3 votes

Is there a way to create a share that does not require username/password when accessed all through the command line?

If you have access to PowerShell V4/WMF4 you can use new-smbshare. Information about new-smbshare found here: New-SMBShare New-SmbShare -Name "VMSFiles" -Path "C:\ClusterStorage\Volume1\VMFiles" -...
3 votes
Accepted

How to change network adapter DNS servers on Windows without using netsh or WIM

NETSH is still what you want to do. You seem to have developed some kind of application, but altering the registry is sure not the way to go. Besides that - I highly recommend you use DHCP and ...
3 votes
Accepted

Is Microsoft moving away from WMI?

PowerShell is the way to go. WMI is not bad, but it’s still up because like you can use WMI filter on your Group Policy and you can get diagnostic data from there. In all my MVP year I never had a ...
  • 16.3k
3 votes
Accepted

Windows SMTP: Script Outbound Security

Solved with much experimentation. Here's the pertinent bits of my script. Note that I'm keeping the SMTP user creds stored in AWS Systems Manager parameter store. $smtpuser = Get-SSMParameter -Name ...
  • 3,434
2 votes

Is there a way to set access to WMI using GroupPolicy?

Referencing https://answers.splunk.com/answers/2703/how-to-enable-wmi-data-collection-on-a-domain-server.html There's no non-esoteric way at this time to globally configure WMI security settings ...
2 votes

How to retrieve names of all private MSMQ queues - efficiently?

With Windows Server 2012 R2 you have the Message Queueing (MSMQ) Cmdlets installed, use the Cmdlet Get-MsmqQueue to get name and count. Get-MsmqQueue | Select QueueName, MessageCount Without Message ...
  • 630
2 votes

What is the closest equivalent of "load average" in Windows available via WMI?

If you're using Python, psutil emulates getloadavg() on Windows via the Processor Queue Length: >>> import psutil >>> psutil.getloadavg() (3.14, 3.89, 4.67) PR showing how this ...
2 votes

Identify Windows 2012 Server core

Some clarification on the answers for local and remote scenarios as performance was discussed. The questioner asked WMI, and his example used PowerShell to invoke WMI. Using WMI directly from ...
2 votes
Accepted

Executing WMI methods by proxy - how can I keep credentials out of the hands of users?

What you're talking about is security through obscurity. You want a group of techs to have permission to do something, but you don't want to give them access to a big, scary console with lots of ...
  • 1,862
2 votes

checking for missing values in WQL or (WQL/WMI filter to return `true` for desktops/servers, but `false` on laptops)

I have a laptop in front of me that does not return an object when querying Win32_PortableBattery, but returns an object when querying Win32_Battery. Probably not a good option to use either of these ...
2 votes
Accepted

Find last run defrag WMI or Reg key

Run a query for Event ID 258 in the Application event log PS F:\ps1> get-winevent -filterHashTable @{Logname = 'Application'; ID = '258';} | select-object -first 1 -prop machinename,timecreated,...
  • 4,493
2 votes

What are the minimal permissions for WMI access to processes CommandLine?

I have finally managed to work around this issue, by giving an AD group more permissions for the individual services. This way, the monitoring tool might be able to control the services to be ...

Only top scored, non community-wiki answers of a minimum length are eligible