PowerShell for Windows Admins:

WMI


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...


July 2, 2014  1:20 PM

CIM or WMI?

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


May 18, 2014  5:16 AM

Share Permissions – changing

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

So far you’ve seen how to read, remove and add permissions to a share. The final scenario to be covered is modifying a permission. The functions I’ve presented to date only enable you to set Allow permissions on a share. I’ll be covering Deny permissions in later posts. This mimics the way...


May 17, 2014  7:02 AM

Share Permissions – Removing

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

You’ve seen how to read share permissions and how to add share permissions – now its time to remove share permissions. Most of the code we need is in the Add-Sharepermission function – it just needs a bit of a tweak. #requires -Version 3.0 function Remove-SharePermission...


May 16, 2014  1:23 PM

Share Permissions – adding

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

Having seen how to read the permissions on a share its time to turn to one of the other common tasks associated with shares – adding permissions. This is usually done when the share is created but there are scenarios where you need to add extra permissions. I’ve written the function...


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: