PowerShell for Windows Admins:

CIM


December 15, 2014  3:54 PM

WMI — identifying writable properties

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

One common mistake I see is people trying to set the value of a read only property on a WMI class.  There isn’t a quick way to see if a property is writable. Get-CimClass can be used but you have to dig into the Qualifiers for each property.   You can use this function to determine...

October 13, 2014  2:22 PM

WMI Associations

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

  I saw a question regarding finding the Win32_NetworkAdapter instance using the matching Win32_NetworkAdapterConfiguration starting point.  This answers the “which adapter has an IP address of X” type question.   The Index property on a Win32_NetworkAdapterConfiguration...


September 22, 2014  2:26 PM

WMI and CIM dates

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

A question on the forum asked about extracting the year from the ReleaseDate property returned by Win32_BIOS   They were trying to do this Get-CimInstance Win32_BIOS | Select-Object @{n="ReleaseDate";e={$_.ConvertToDateTime($_.ReleaseDate).year()}}   There are 2 problems...


September 8, 2014  1:36 PM

CimInstanceProperties

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

If you use Get-CimInstance and examine the object returnd – you’ll find some meta-data at the end of the object: CimClass                                  : root/cimv2:Win32_OperatingSystem CimInstanceProperties                     :...


August 10, 2014  2:51 AM

WMI troubleshooting

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

A WMI troubleshooting series has been started on the Ask the Performance Team Blog. The overview article is: Bookmark and Share     0 Comments     RSS Feed     Email a friend


August 5, 2014  12:42 PM

ServerManagerTasks module – – Get-SMServerFeature

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

Finding the Windows features installed on a remote machine can be an interesting task. You could use Get-WindowsFeature but that gives you a “graphical” display: £> Get-WindowsFeature | where DisplayName -like '*DNS*' Display Name        ...


July 13, 2014  9:34 AM

Formatting disks

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

Saw a question on the forums about formatting all disks but the C: drive.  Assuming you ever need to do such a destructive activity you might want think about ths sort of approach Get-CimInstance -ClassName Win32_Volume -Filter "DeviceId != 'C:'" | foreach { Invoke-CimMethod -whatif...


July 11, 2014  12:39 PM

CIM or WMI – – accessing remote machines

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

I much prefer the CIM cmdlets for accessing remote machines. The WMI cmdlets use DCOM which is firewall unfriendly and can often be unavailable of a server – cue the dreaded RPC server is unavailable error messages. By contrast the CIM cmdlets use WSMAN. For one off access to a remote...


July 7, 2014  12:45 PM

Finding a CIM class

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

I was investigating something on my disks and started to look at the partitions: £> Get-CimInstance -ClassName Win32_Partition Get-CimInstance : Invalid class At line:1 char:1 + Get-CimInstance -ClassName Win32_Partition + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +...


July 6, 2014  3:22 PM

CIM or WMI – – using methods

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, WMI

The CIM and WMI cmdlets both provide a way to use the methods on CIM classes namely Invoke-CimMethod and Invoke-WmiMethod. The cmdlets are very similar in operation. $vol = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = 'D:'" Invoke-WmiMethod -InputObject $vol -Name Chkdsk...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: