You can use the below script to get the list of connected NICs, Private EndPoints and VNet Integrated resources for all the subnets in the VNet.
$Vnet = Get-AzVirtualNetwork -Name <VNet Name> -ResourceGroup <RG Name>
foreach ($subnet in $Vnet.Subnets){
Write-Host "Name: " $subnet.Name
Write-Host "Address Range: " $subnet.AddressPrefix
Write-Host "`n"
Write-Host "List of Private EndPoints:"
foreach ($pe in $subnet.PrivateEndPoints){
$pe.Id
}
Write-Host "`n"
Write-Host "List of Connected NICs:"
foreach ($nic in $subnet.IpConfigurations){
$nic.Id
}
Write-Host "`n"
Write-Host "VNet Integration"
foreach ($sal in $subnet.ServiceAssociationLinks ){
$sal.Link
}
Write-Host "`n"
Write-Host "End of Subnet"
Write-Host "`n"
}
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.