Skip to content

Invoke-MgmtGraphRenewGroup

MgmtGraph: Renews a Microsoft Graph group

#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Groups

[CmdletBinding()]
Param (
    [Parameter(Mandatory = $true, Position = 0)]
    [string]$GroupId
)

Process {
    try {
        $params = @{
            'GroupId'     = $GroupId
            'Confirm'     = $false
            'ErrorAction' = 'Stop'
        }

        Invoke-MgRenewGroup @params

        $result = [PSCustomObject]@{
            GroupId   = $GroupId
            Status    = "Renewed"
            Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
        }

        Write-Output $result
    }
    catch {
        throw
    }
}

The unique identifier of the Microsoft Graph group to renew.

An interactive directory of PowerShell scripts.