Connect Az-Account
Get-AZPublicIPAddress | select Name,IpAddress,PublicIpAllocationMethod
az login
az network public-ip list –query ‚[].[name, ipAddress, publicIpAllocationMethod]‘ –o table
Connect-AzAccount
$subs = Get-AzSubscription
ForEach ($sub in $subs) {
Set-AzContext -SubscriptionID $sub.ID
$nsgs = Get-AzNetworkSecurityGroup
foreach ($nsg in $nsgs){
$nsg | Get-AzNetworkSecurityRuleConfig `
| where {$_.sourceaddressprefix -eq „*“ -and $_.Access -eq „Allow“}
}
}
