As I frequently do when I’m looking for a topic to blog about, I reach for my favorite tool – PowerShell. Over the weekend I was reading some of the aforementioned book and I came across a set of tasks which do not have corresponding cmdlets out-of-the-box.

There are a set of functions described in Chapter 8 – Managing Site Collections and Sites which can be created and used to manage SharePoint Groups. There are 3 functions: Get-SPGroup, New-SPGroup and Remove-SPGroup. This post will only focus on the first and easiest, Get-SPGroup.

The Get-SPGroup function is pretty simple, and other than my obligatory comment-based help (which accounts for 23 of the 33 lines 🙂 ) – this function is very short.

Essentially all it’s doing is obtaining the SiteGroups collection property from an SPWeb object and returning the information on the property.