Powershell – How to take ownership of a security group as the Exchange administrator

exchange-2010microsoft-office-365powershell

We are using Exchange 2010 as part of an Office 365 subscription. We have a security group owned by Alice only. Without using Alice's account, how can the administrator take ownership of that security group?

PS C:\> Get-DistributionGroup "SecurityGroupX" |
          Select ManagedBy -ExpandProperty "ManagedBy"

namprd00.prod.outlook.com/Microsoft Exchange Hosted Organizations
/example.onmicrosoft.com/alice

I am a member of the Organization Management role, so I expected to be able to override this permission. I tried using the Exchange management portal, and I also tried using PowerShell:

PS C:\> Set-DistributionGroup "SecurityGroupX" -ManagedBy "stephen@example.com"

You don't have sufficient permissions. This operation can only be performed by a 
manager of the group.
    + CategoryInfo          : NotSpecified: (:) [Set-DistributionGroup], OperationRequiresGroupManagerException
    + FullyQualifiedErrorId : 99CEE042,Microsoft.Exchange.Management.RecipientTasks.SetDistributionGroup
    + PSComputerName        : bl0prd0000psh.outlook.com

Best Answer

In the course of asking this question I found the answer. Set-DistributionGroup has a parameter -BypassSecurityGroupManagerCheck for this purpose.

PS C:\> Set-DistributionGroup "SecurityGroupX" `
             -ManagedBy "stephen@example.com" `
             -BypassSecurityGroupManagerCheck