OMI/CIM/WMI dictionary
Don Jones provides a very good summary of the similarities and differences between WMI, CIM and OMI http://powershell.org/wp/2015/04/24/management-information-the-omicimwmimidmtf-dictionary/...
View ArticleCIM filters
I was looking up Win32_SystemDriver on the MSDN site and noticed there was some PowerShell example code Get-WmiObject -Class Win32_SystemDriver | Where-Object -FilterScript {$_.State -eq “Running”} |...
View ArticleDisk identification
A recent question on the forums regarded using the Win32_LogicalDisk class to retrieve disk size and free space data. A filter based on the disk letter was being used. The main error with the code was...
View ArticleWMI dates
Dates as reported by WMI still seem to cause a lot of problems. If you use the WMI cmdlets £> Get-WmiObject -Class Win32_OperatingSystem | select *date* | fl InstallDate :...
View ArticleWin32_ReliabilityRecords Class
The Win32_ReliabilityRecords class was introduced with Windows 7. It contains information from the Windows Event Log related to system reliability. The most interesting properties are the Message and...
View ArticleNICs with IP addresses
A question on the forum asked about discovering those network adapters that had IP addresses configured. The user had tried PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter...
View ArticleWMI linked classes
You will find that many WMI classes have links – some are associations built in to WMI (a subject for another time) while other classes can be linked based on property values. An example of the latter...
View ArticleWMI cmdlets and credentials
If you’re working with the WMI cmdlets and need to pass credentials you’ll end up with a statement something like this Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computer -Credential...
View ArticleWMI wildcards and filtering
A question on the forum asking about filtering WMI results raises a number of interesting points. The user wanted to pass a computername and a filter term to pull product information from remote...
View ArticleAccessing WMI
There are 3 sets of cmdlets for working with WMI classes – the WMI cmdlets, the WSMAN cmdlets and the CIM cmdlets. The protocols used by these 3 sets are different. The WMI cmdlets introduced in...
View ArticleCreating Registry Key
I had a question left on the blog asking how to create a registry key. My preferred method is to use the CIM class = StdRegProv. Its a static class so you don’t need to create an object [uint32]$hklm =...
View ArticleNew-CimInstance cmdlet and the–Key parameter
I was asked a question about the –Key parameter on New-CimInstance today. I wasn’t sure of the answer so I’ve done some experimentation. I tend to avoid New-CimInstance if I can preferring to use the...
View ArticleBinaryMiLog cmdlets
It’s not often I come across soemthing brand new in PowerShell but yesterday when I was investigating New-CimInstance I discovered 2 cmdlets in the CimCmdlets module I hadn’t noticed before. These are:...
View ArticleWMI discovery
I’ve been working with System Center Configuration Manager this week. SCCM uses a lot of WMI. However, WMI discovery is still a bit of an art. I needed to find the SMS_SCI_Component class. If you know...
View ArticleCDXML filter parameters
I was recently asked about adding a filter parameter to a cmdlet created through CDXML. If you’ve not seen it before (see PowerShell and WMI Chapters 18 & 19 from www.manning.com) CDXML allows you...
View ArticleNetwork adapter Index
A few years ago I wrote a post about setting the IP metric on a connection – https://richardspowershellblog.wordpress.com/2012/01/01/changing-ip-connection-metric/ I was recently asked if the Index’s...
View ArticleIIS 6.0 server information
A question of the forum asked about getting data from IIS 6.0 servers One of the ways to access this data is to use CIM (WMI). IIS 6.0 has the root\MicrosoftIIsV2 namespace. Later versions of Windows...
View ArticleIIS information
In my recent post about getting server information from a IIS web server I said I post about getting similar information from later machines. You still have the root\MirosoftIISv2 namespace available...
View ArticleMonitor Info
A question on the forum about combining information from 2 CIM classes produced this: function Get-MonitorInfo { [CmdletBinding()] param( $computername = $env:COMPUTERNAME ) $cs = New-CimSession...
View ArticleFolder creation dates from WMI
A question on the powershell.org about finding the creation date of folders raises some interesting points To find a folder’s creation date use: Get-WmiObject -Class Win32_Directory -Filter “Drive=’C:’...
View Article