Skip to main content
11 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 ...
TessellatingHeckler's user avatar
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 ...
DisplayName's user avatar
5 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-...
MandatoryMoniker's user avatar
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( "...
JosefZ's user avatar
  • 1,584
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 ...
Mathias R. Jessen's user avatar
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'.
natxo asenjo's user avatar
  • 5,839
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 ...
Anubioz's user avatar
  • 3,735
3 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 ...
Giampaolo Rodolà's user avatar
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" -...
Tim Haintz's user avatar
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 ...
Florian Rossmark's user avatar
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 ...
yagmoth555's user avatar
  • 17.2k
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 ...
Chris_K's user avatar
  • 3,424
2 votes

Which permissions/rights does a user need to have WMI access on remote machines?

Nothing here worked for me. I found a YT vid in conjunction with an arbitrary comment that solved it for me (& hopefully for you, too), but only when using invoke-command (ex. invoke-command -...
velkoon's user avatar
  • 121
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 ...
thinknot's user avatar
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 ...
Matthew Wetmore's user avatar
2 votes

Win32_LogicalDisk doesn't retrieve network drives from remote machines

As far as I have researched, there are 2 places Windows stores networks drives (Map drives, if you exclude PS-drives). One is WMI, as mentioned here, you can get this information in WMI ...
Daniel Lindegaard's user avatar
2 votes
Accepted

How to parse WMIC output in a batch file and compare to an array?

Here is one way to do it: @echo off setlocal enableDelayedExpansion set "SCCMSiteCodes= 'AAA' 'BBB' 'CCC' 'GGG 'VVV' " for /f delims^=^"^ tokens^=2^ eol^= %%A in ( 'wmic /namespace:\\root\ccm path ...
dbenham's user avatar
  • 661
2 votes
Accepted

GPO WMI filter not excluding computers

The WMI query is invalid. You should test this using wbemtest.exe or WMICodeCreator before linking it to a GPO. Here is an example of a working query: SELECT NAME FROM Win32_ComputerSystem ...
Greg Askew's user avatar
  • 37.1k
2 votes

Blank iSCSI targets but targets still active

I have also noticed similar behavior under Windows Server 2012. This can be just a visual glitch. Use "Get-IscsiSession" Powershell cmdlet to ensure that iSCSI Initiator is working properly. If there ...
Strepsils's user avatar
  • 5,125
2 votes

WMI Query to identify virtual machines under Server 2012 R2

See also: https://stackoverflow.com/questions/15485601/how-to-check-my-windows-server-is-virtual-machine-or-physical-machine Consider trying gwmi win32_baseboard. Results below are using Windows as ...
Matthew Wetmore's user avatar
2 votes
Accepted

Install SCCM application to client via powershell, comand line or WMI

Here is a solution in vbscript if you're interested. I'm not well versed in powershell yet but I do alot of .net and vbscript automation of SCCM. I'm sure someone here could translate to powershell. ...
Paul G's user avatar
  • 158
2 votes
Accepted

Win32_LogonSessions returns older sessions

You are observing this behavior because Microsoft Security Bulletin MS16-111 contains an update that changed the way that Windows handles logon session objects. Now any service or application, either ...
Ryan Ries's user avatar
  • 55.9k
2 votes

Powershell Get-WMIObject fails with “Invalid class” error

root\virtualization has been removed in recent versions of Hyper-V. You want root\virtualization\v2.
Jake Oshins's user avatar
  • 5,166
2 votes

WMI Filter to detect Windows 10 Creators Update or higher

Microsoft don't easily allow that, for the exact reason you found, it's a string, not a number. Please see WMI Group Policy filters that compare Win32_OperatingSystem BuildNumber don't work as ...
yagmoth555's user avatar
  • 17.2k
2 votes
Accepted

Importing GPO WMI filter .mof file

A .mof is an input file to the mofcomp utility which is present on every Windows system. You just need to provide the file name and the corresponding namespace as parameters to make it work. The file ...
the-wabbit's user avatar
2 votes

In Powershell, how to check drive space on remote server with non-admin account?

Very much appreciate the noted answer, but I wanted a little more consistency in my implementation and I finally stumbled across the older PowerShell DSC resource below, but I'm also adding what's ...
QuilleyPowers's user avatar
2 votes

Uninstalled Program(s) still appear in WMI Object “WIN32_InstalledStoreProgram”?

My issue was with the HEVCVideoExtension, but otherwise similar. I tried it this way from an Admin PowerShell prompt: Get the full package name using: Get-AppxPackage -AllUsers -Name "Microsoft....
John Kintzele's user avatar
2 votes

Windows 10 Offline files synchronization monitoring

Start Event Viewer and go to Applications and services logs > Microsoft > Windows > Offline files. Then go to the View menu and choose Show analytic and debug logs which will give you some ...
Ace's user avatar
  • 746
2 votes

Could not establish WMI connection access is denied

Your -localcredential doesn't look right. It should be an administrator credential for the workgroup computer, e.g. SWC2-PC\Administrator. Your [email protected] looks like a domain UPN, and that's not ...
LeeM's user avatar
  • 1,433
1 vote
Accepted

List 3rd party WMI providers before rebuilding repository

Given how WMI was built and implemented you're a bit SOL on a magical solution. I can help you some of the way, but you're still going to have to eyeball the results. Essentially you need to start ...
Colyn1337's user avatar
  • 2,427

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