Public/Get-NSPEntraConnectSourceAnchor.ps1

function Get-NSPEntraConnectSourceAnchor {
    <#
    .SYNOPSIS
        Reports which source anchor Entra Connect Sync uses, and whether that is verified. Read-only.
    .DESCRIPTION
        Run on the sync server. It reads the effective inbound user rules of every AD connector, not
        only the global setting, and returns:
          - Provenance: Verified or Unverified, with Reasons when Unverified.
          - Strategy: ObjectGuid, ConsistencyGuid, ConsistencyGuidWithObjectGuidFallback or Unknown.
          - Evidence: each flow into the anchor, with its rule, source object type and flow text, so
            an Unverified result can be diagnosed.
 
        Unverified blocks hard-match writes. A blank mS-DS-ConsistencyGuid on a user never proves the
        anchor is objectGUID, so user data plays no part here. The output names connectors and rules:
        treat it as topology and keep it out of Git and Coordination.
    .EXAMPLE
        $anchor = Get-NSPEntraConnectSourceAnchor
        $anchor.Provenance
    #>

    [CmdletBinding()]
    [OutputType('NSP.M365.UserPairing.SourceAnchor')]
    param()

    $state = Read-NSPEntraConnectState
    ConvertTo-NSPEntraSourceAnchorResult -Rule $state.Rule -Connector $state.Connector -GlobalParameter $state.GlobalParameter `
        -ComputerName $env:COMPUTERNAME -ModuleVersion $state.ModuleVersion
}