Skip to content

Get-MgmtGraphWindowInformationProtectionNetworkSummary

MgmtGraph: Audits WIP network learning summaries

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

[CmdletBinding()]
Param (
    [Parameter(Position = 0)]
    [string]$Identity
)

Process {
    try {
        $params = @{
            'ErrorAction' = 'Stop'
        }

        if ($Identity) {
            $params.Add('WindowsInformationProtectionNetworkLearningSummaryId', $Identity)
        }
        else {
            $params.Add('All', $true)
        }

        $summaries = Get-MgDeviceManagementWindowInformationProtectionNetworkLearningSummary @params
        
        $results = foreach ($s in $summaries) {
            [PSCustomObject]@{
                Url         = $s.Url
                DeviceCount = $s.DeviceCount
                Id          = $s.Id
                Timestamp   = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
            }
        }

        Write-Output ($results | Sort-Object Url)
    }
    catch {
        throw
    }
}

Optional. Specifies the ID of the WIP network learning summary to retrieve. If omitted, all summaries are listed.

An interactive directory of PowerShell scripts.