ExchangeOnlineManagement version 2.0.5 released

In case you missed it, a new version of the ExchangeOnlineManagement PowerShell module was released over the weekend, namely 2.0.5. The changelog for this version is rather short and only lists four new added cmdlets:

  • Get-OwnerlessGroupPolicy and Set-OwnerlessGroupPolicy, used to retrieve and manage the Ownerless Group policy object, or in other words the policy which controls what happens to a group without an owner
  • Get-VivaInsightsSettings and Set-VivaInsightsSettings, used to manage the availability of Headspace features in Viva Insights, whatever that is.

Let’s take a quick look at the Ownerless group policy cmdlets first. Some rough edges are immediately visible, for example if you run the Get-OwnerlessGroupPolicy cmdlet when connected via CBA, you get the following error:

Get-OwnerlessGroupPolicy
Get-OwnerlessGroupPolicy: Error while requesting REST service. HttpStatusCode=Unauthorized

The CBA-enabled module has traditionally had issues with Groups-related functionality, due to the nature of the group (and group policy) objects, so that’s not that surprising. What is surprising though is that running the same cmdlet with a regular user account also throws an error:

Get-OwnerlessGroupPolicy
Get-OwnerlessGroupPolicy : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-OwnerlessGroupPolicy
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ProtocolError: (:) [Get-OwnerlessGroupPolicy], NullReferenceException
+ FullyQualifiedErrorId : Object reference not set to an instance of an object.,Microsoft.Exchange.Management.RestApiClient.OwnerlessGroups.GetOwnerlessGroupPolicy

A simple “no policy is configured” output would’ve been better. Things are a bit messy when using the Set-OwnerlessGroupPolicy cmdlet too, running it without any parameters will prompt you to provide a value for the Enabled parameter and proceed with creating the policy object:

Set-OwnerlessGroupPolicy

cmdlet Set-OwnerlessGroupPolicy at command pipeline position 1
Supply values for the following parameters:
Enabled:

Enabled : False
SenderEmailAddress :
NoOfWeeksToNotify : 0
MaxNoOfMembersToNotify : 0
EnabledGroupIds : {}

As a result, we can now run the Get-OwnerlessGroupPolicycmdlet with success:

Get-OwnerlessGroupPolicy

Enabled : False
SenderEmailAddress :
NoOfWeeksToNotify : 0
MaxNoOfMembersToNotify : 0
EnabledGroupIds : {}

Putting the cmdlet oddities aside, the Ownerless group policy is a nice addition that will help address scenarios where the last owner of a group is removed for some reason (for example when leaving the company). Once you enabled the policy, an email will be sent to the current members of a given ownerless group, asking them to “volunteer” as a group owner. The policy settings allow you to specify how long the emails should be sent for (as the parameter name, NoOfWeeksToNotify, suggests, value is in weeks), and how many members should be probed (MaxNoOfMembersToNotify). In addition, you can also control the sender email address, via the SenderEmailAddress parameter. And should you want to only enable this feature for specific set of groups, instead of all, you can provide a comma-separated list of up to 10 group ID entries via the EnabledGroupIds parameter. Here’s an example of running the cmdlet with some settings that make sense:

Set-OwnerlessGroupPolicy -Enabled $true -SenderEmailAddress GroupGovernance@michev.info -NoOfWeeksToNotify 4 -MaxNoOfMembersToNotify 5

Let’s also briefly cover the *-VivaInsightsSettings cmdlets. Run the Get-VivaInsightsSettings to check whether a given user is enabled for Viva Insights. Make sure to specify the UPN/email address of the user though, as with other Graph-based cmdlets:

Get-VivaInsightsSettings -Identity user@domain.com

UserId IsInsightsHeadspaceEnabled
------ --------------------------
user@domain.com True

To enable (or disable) a given user for Viva Insights, use the Set-VivaInsightsSettings cmdlet:

Set-VivaInsightsSettings -Identity gosho@michev.info -Enabled $false -Feature headspace

UserId IsInsightsHeadspaceEnabled
------ --------------------------
gosho@michev.info False

Note that you do need to provide the Feature parameter, which only accepts the headspace value currently. The Enabled parameter control the user state for the given feature. And that’s pretty much all there is to it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.