-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
234a0c1
commit 1ffcfbb
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Ensure you have Azure PowerShell module installed and logged in | ||
# Install-Module -Name Az -AllowClobber -Scope CurrentUser | ||
# Connect-AzAccount | ||
|
||
$resourceGroup = 'devResourceGroup' | ||
|
||
# Fetch all VMs in the resource group | ||
$vms = Get-AzVm -ResourceGroupName $resourceGroup | ||
|
||
# Fetch NICs, Public IPs, and VNets | ||
$nics = Get-AzNetworkInterface -ResourceGroupName $resourceGroup | ||
$publicIps = Get-AzPublicIpAddress -ResourceGroupName $resourceGroup | ||
$vnets = Get-AzVirtualNetwork -ResourceGroupName $resourceGroup | ||
$firewalls = Get-AzFirewall -ResourceGroupName $resourceGroup | ||
$bastions = Get-AzBastion -ResourceGroupName $resourceGroup | ||
|
||
# Display VMs information | ||
Write-Host "VMs Status:" | ||
$vms | ForEach-Object { | ||
Write-Host "$($_.Name): PowerState=$($_.PowerState)" | ||
} | ||
|
||
# Display NICs information | ||
Write-Host "`nNetwork Interface Cards (NICs):" | ||
$nics | ForEach-Object { | ||
Write-Host "$($_.Name): IP=$($_.IpConfigurations.PrivateIpAddress)" | ||
} | ||
|
||
# Display Public IPs information | ||
Write-Host "`nPublic IPs:" | ||
$publicIps | ForEach-Object { | ||
Write-Host "$($_.Name): IP=$($_.IpAddress)" | ||
} | ||
|
||
# Display VNet information | ||
Write-Host "`nVirtual Networks (VNets):" | ||
$vnets | ForEach-Object { | ||
Write-Host "$($_.Name): Address Space=$($_.AddressSpace.AddressPrefixes)" | ||
} | ||
|
||
# Display Azure Firewall information | ||
Write-Host "`nAzure Firewall Configurations:" | ||
$firewalls | ForEach-Object { | ||
Write-Host "$($_.Name): IP Configurations=$($_.IpConfigurations.PrivateIpAddress)" | ||
} | ||
|
||
# Display Bastion Host information | ||
Write-Host "`nAzure Bastion Hosts:" | ||
$bastions | ForEach-Object { | ||
Write-Host "$($_.Name): IP=$($_.IpConfigurations.IpAddress)" | ||
} | ||
|
||
# Network Connectivity Tests to Public IPs (Example) | ||
# You can use Test-NetConnection for basic connectivity tests to public IPs | ||
Write-Host "`nNetwork Connectivity Tests to Public IPs:" | ||
$publicIps | ForEach-Object { | ||
$testResult = Test-NetConnection -ComputerName $_.IpAddress -Port 80 | ||
Write-Host "$($_.Name) to $($_.IpAddress): $($testResult.PingSucceeded)" | ||
} | ||
|
||
# Note: This script assumes you have the necessary permissions and that your environment is configured for the Azure PowerShell module. | ||
# Adjust the script as per your specific needs and Azure setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Streamlined verification script without defining multiple variables | ||
|
||
# List all resources in the resource group 'devResourceGroup' | ||
az resource list --resource-group devResourceGroup --output table | ||
|
||
# Verify Virtual Networks and Subnets | ||
az network vnet list --resource-group devResourceGroup --output table | ||
|
||
# Check Virtual Machines | ||
az vm list --resource-group devResourceGroup --show-details --output table | ||
|
||
# Verify Network Interface Cards | ||
az network nic list --resource-group devResourceGroup --output table | ||
|
||
# Check Public IP Addresses | ||
az network public-ip list --resource-group devResourceGroup --output table | ||
|
||
# Inspect Azure Firewall Configuration | ||
az network firewall show --name hubVnet-firewall --resource-group devResourceGroup --output json | ||
|
||
# Inspect Bastion Host | ||
az network bastion show --name hubVnet-bastion --resource-group devResourceGroup --output json |