PowerShell for Windows Admins:

WMI


August 10, 2014  2:51 AM

WMI troubleshooting

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, 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, PowerShell, 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, PowerShell, 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, PowerShell, 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, PowerShell, 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, PowerShell, 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...


July 2, 2014  1:20 PM

CIM or WMI?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell, WMI

Working with WMI became a whole easier when PowerShell came on the scene. If you ever spent hours typing all of the Echo commands that were required with VBScript to produce output you’ll be aware of what I mean.  There are still a few awkward areas in the WMI cmdlets. One of the most awkward is...


May 19, 2014  1:00 PM

Share Permissions – setting deny

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

The last change to the share permissions functions to modify the Set-SharePermissions functions to enable the application of Deny permissions. The function becomes: #requires -Version 3.0 function Set-SharePermission { [CmdletBinding()] param...


May 18, 2014  12:44 PM

Share Permissions – adding a Deny permission

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

Modifying the Add-SharePermission function to enable the application of Deny permissions is a simple matter of adding a switch parameter –deny and modifying the way the AcreType is set: #requires -Version 3.0 function Add-SharePermission { [CmdletBinding()] param...


May 18, 2014  8:40 AM

Share Permissions – working with Deny

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

Permissions can be set to either allow access ot to deny access. The functions I’ve presented so far only work with Allow permissions. Using Deny permissions should be avoided if at all possible but sometimes there’s no alternative. First thing is to modify Get-SharePermission so that it...


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: