Skip to content

Get-MgmtGraphGroupRejectedSenderCount

MgmtGraph: Retrieves the count of rejected 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-MgGroupRejectedSenderCount -GroupId $GroupId -ErrorAction Stop
        
        $result = [PSCustomObject]@{
            GroupId             = $GroupId
            RejectedSenderCount = $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.