Connect-AzAccount -Tenant 'xxxxx' -SubscriptionId 'xxxx'
# Get the Resource Group Name
$resourceGroupName = "city-app-rg-xx-uat"
# Get all Private Endpoints in the Resource Group
$privateEndpoints = Get-AzPrivateEndpoint -ResourceGroupName $resourceGroupName
# Create a list to store the data
$data = @()
# Loop through each Private Endpoint
foreach ($privateEndpoint in $privateEndpoints) {
$fqdn = $privateEndpoint.PrivateDnsZoneGroup.Name
$ipAddresses = $privateEndpoint.PrivateIPAddresses -join ","
$name = $privateEndpoint.Name
$data += [PSCustomObject]@{
FQDN = $fqdn
IPAddress = $ipAddresses
Name = $name
}
}
# Export the data to a CSV file
$data | Export-Csv -Path "PrivateEndpointDetails.csv" -NoTypeInformation
Output received:
In the output, the Fully Qualified Domain Name (Private endpoint URL) and the Private IPs of the azure resources are not printed in the output file.
Unable to identify what is wrong in the above PowerShell script.
2
Answers
I might not have exactly what your looking for but you can use this to get the information at least, you can then use it to scope it differently for your need 🙂
Hope this is helpful and remember shared knowledge is the best knowledge 😊
Best Regards,
Timmy Malmgren
If the Answer is helpful, please click "Accept Answer" and upvote it as it helps others to find what they are looking for faster!
Here is the updated
PowerShell
script to fetch the private endpoint FQDN and Private IP address.Output:
Excel Output