Skip to content

Get-MgmtGraphGroupAcceptedSenderCount

MgmtGraph: Retrieves the count of accepted senders for a group

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

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

Process {
    try {
        $count = Get-MgGroupAcceptedSenderCount -GroupId $GroupId -ErrorAction Stop
        
        $result = [PSCustomObject]@{
            GroupId             = $GroupId
            AcceptedSenderCount = $count
            Timestamp           = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
        }

        Write-Output $result
    }
    catch {
        throw
    }
}

The unique identifier of the Microsoft Graph group.

An interactive directory of PowerShell scripts.