Category Archives: PowerShell and CIM

WMI and CIM accelerators

In PowerShell an accelerator is a shortcut to a .NET type. The WMI accelerators have been around since PowerShell v1. The WMI accelerators were heavily used in v1 fill some of the gaps in cmdlet coverage. The CIM accelerators appeared … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | Leave a comment

CIM references and associations

Way back in 2011, when I were just a young lad, I wrote about WMI or CIM references and associations – https://wordpress.com/read/blogs/16267735/posts/1673 ASSOCIATORS show the end point of the link between CIM classes and REFERENCES shows the linking class. I … Continue reading

Posted in PowerShell and CIM | Leave a comment

CIM_ or Win32_

If you dig into the classes available on a Windows machine you’ll see a mixture of prefixes – namely CIM_ and Win32_ used for the classes. So which should you use CIM_ or Win32_ Lets start by seeing whats available: … Continue reading

Posted in PowerShell and CIM | Leave a comment

Windows Updates CIM classes

When Windows 10 and Server 2016 were released they contained a new CIM namespace – ROOT/Microsoft/Windows/WindowsUpdate This contained a CIM class MSFT_WUOperationsSession that had 2 very useful methods – ScanForUpdates and  ApplyApplicableUpdates. These methods enabled you to find and install … Continue reading

Posted in PowerShell and CIM, WSUS | 1 Comment

Monitor resolution

A question on the forum about getting monitor resolution led to this code Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorId | foreach {        $filter = (“InstanceName = ‘$($psitem.InstanceName)'”).Replace(“`\”, “`\`\”)         $maxres = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorListedSupportedSourceModes -Filter $filter … Continue reading

Posted in PowerShell and CIM | Leave a comment

Use CIM cmdlets not WMI cmdlets

WMI and CIM seem to cause a LOT of confusion. Its really simple. CIM is an industry standard from DMTF.org. WMI was Microsoft’s implementation of CIM way back in Windows NT days. The complication is that Microsoft had a set … Continue reading

Posted in PowerShell and CIM | 3 Comments

Examples of replacing WMI cmdlet with CIM cmdlet

Following my last post I was asked about these Examples of replacing WMI cmdlet with CIM cmdlet. Example 1 gwmi win32_operatingsystem -computername $Computer -credential $creds, $cs = New-CimSession -Credential $creds -ComputerName $computer Get-CimInstance -ClassName Win32_operatingsystem -CimSession $cs Example 2 get-wmiobject … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | 1 Comment