All scripts
Azure AI 88

Get-AzurePrivateEndpointReport

Lists every private endpoint in the subscription, the resource it connects to, and its connection approval status, useful for confirming private connectivity actually landed where expected.

Get-AzurePrivateEndpointReport.ps1
<#
.SYNOPSIS
    Reports private endpoints and their connection status.

.DESCRIPTION
    Lists every private endpoint in the subscription along with the
    target resource and connection approval state, useful for
    confirming private connectivity actually landed where expected
    after a deployment.

.EXAMPLE
    .\Get-AzurePrivateEndpointReport.ps1

.NOTES
    Requires the Az.Network module and an active Connect-AzAccount session.

.AUTHOR
    Shehryar Hassan
#>

$endpoints = Get-AzPrivateEndpoint

$report = $endpoints | ForEach-Object {
    [pscustomobject]@{
        Name           = $_.Name
        ResourceGroup  = $_.ResourceGroupName
        TargetResource = ($_.PrivateLinkServiceConnections[0].PrivateLinkServiceId -split "/")[-1]
        ConnectionState = $_.PrivateLinkServiceConnections[0].PrivateLinkServiceConnectionState.Status
    }
}

$report | Format-Table -AutoSize
$report | Where-Object { $_.ConnectionState -ne "Approved" } | ForEach-Object { Write-Warning "$($_.Name) connection state: $($_.ConnectionState)" }

Read it before you run it, and test in a safe tenant first.