# Cim or Wmi

**URL:** <https://forums.powershell.org/t/cim-or-wmi/5669>\
**Category:** PowerShell Help\
**Created:** [February 1, 2016, 4:36pm UTC](https://forums.powershell.org/t/cim-or-wmi/5669 "2016-02-01T16:36:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam-kemp](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@liam-kemp](https://forums.powershell.org/u/liam-kemp)\
**Post date:** [February 1, 2016, 4:36pm UTC](https://forums.powershell.org/t/cim-or-wmi/5669/1 "2016-02-01T16:36:22Z")

</div>

Should I use Get-CimInstance or Get-WmiObject?  
Using Visual Studio Code with the powershell extension - I get a warning when using Wmi that I should use Cim. But using Sapien Powershell Studio 2015 the intellesense stuff doesn’t bring up the list of classes when I use Cim, but it does when I use Wmi, which makes it easier when i’m looking for what I want. I’ve also watched some fairly recent powershell videos on [Lynda.com](http://Lynda.com) and pluralsight where Wmi is still being used.

---

<div class="post-metadata">

**Author:** ![curtis-smith](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/curtis-smith/32/121_2.png) [@curtis-smith](https://forums.powershell.org/u/curtis-smith)\
**Post date:** [February 1, 2016, 5:18pm UTC](https://forums.powershell.org/t/cim-or-wmi/5669/2 "2016-02-01T17:18:12Z")

</div>

You should use Get-CimInstance if you can. It’s not always feasible however. Get-CimInstance relies on WinRM. So if you do not have WinRM enabled in your environment, you have to stick with Get-WmiObject. Get-CimInstance is what MS is developing going forward. One of the beautify things about Get-CimInstance is that is strives to more heterogeneous usage, whereas Get-WmiObject is only usable against Windows Platforms.

Here is a nice blog comparing the two.

> **[Introduction to CIM Cmdlets](https://devblogs.microsoft.com/powershell/introduction-to-cim-cmdlets/)**
>
> PowerShell 3.0 shipping with Windows server 2012 and Windows 8 brings a new set of Cmdlets to manage any server or device that complies with CIM and WS-Man standards defined by DMTF. In this blog post we will explore these new Cmdlets and how can...

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [February 1, 2016, 7:47pm UTC](https://forums.powershell.org/t/cim-or-wmi/5669/3 "2016-02-01T19:47:27Z")

</div>

This deserves a longer answer so I’ll put up a blog post on it. Short answer is that the CIM cmdlets are the preferred way forward. The WMI cmdlets are unlikely to be developed any further - in fact the Get-WmiObject help files states ‘Starting in Windows PowerShell 3.0, this cmdlet has been superseded by Get-CimInstance.’

As stated above the CIM cmdlets use WSMAN (you need the WinRM service running but you don’t need to have enabled PowerShelll remoting - modern Windows server OSs have it enabled anyway) though can drop back to DCOM if needed. WMI cmdlets use DCOM

The CIM cmdlets also unravel dates into a usable format

Invoke-CimMethod uses a hash table for method parameters so avoids the order issue that Invoke-WmiMethod has.

One draw back to the CIM cmdlets is that you can’t access ammended data on the WMI class - but thats not something done frequently

Get-CimClass is great for discovery. The ability to refresh an object is useful.

I always recommend, and use, the CIM cmdlets these days. if you see material recommending the WMI cmdlets contact that author and suggest he brings his material up to date

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:42pm UTC](https://forums.powershell.org/t/cim-or-wmi/5669/4 "2024-05-16T20:42:59Z")

</div>

Closed on May 16, 2024, 8:42pm UTC


