Team,
I am working on a reporting script and i need to extract lot of information from Azure PS cmdlet “Get-azurermnetworkinterface” follwoing is a sample of the output this cmdlet returns for a single NIC.
now I have several NICs and i am unable to find a way to extract properties like PrivateIPAddress, PrivateIPAddressAllocationMethod etc. basically i face issues with extracting nested properties. i want to send them to a excel sheet which pops on the screen right after i run the script. i have done this for Name, ResourceGrupName, Location etc.
plesae suggest how can i extract nested properties.
Name : dhk-sdwec
ResourceGroupName : HKDR-RG01
Location : eastasia
Id : /subscriptions//resourceGroups//providers/Microsoft.Network/networkInterfaces/sdedhk-csha1c1sql581dfe
Etag : W/“9c2b13ff-5a2c-4d54-9760-1bce7aea475d”
ResourceGuid : 359a46d8-15c7-4d94-b4d6-sdfawesvasde08098
ProvisioningState : Succeeded
Tags :
VirtualMachine : {
“Id”: “/subscriptions/53d36695-014d-4471-b844-ef2204ae5868/resourceGroups/HKDR-RG01/providers/Microsoft.Compute/virtualMachines/DHK-CSHA1C1SQL”
}
IpConfigurations : [
{
“Name”: “ipconfig1”,
“Etag”: “W/"”“,
“Id”: “IDhere”
/ipConfigurations/ipconfig1”,
“PrivateIpAddress”: “10.X.X.X”,
“PrivateIpAllocationMethod”: “Static”,
“Subnet”: {
“Id”: “”,
“ResourceNavigationLinks”:
},
“ProvisioningState”: “Succeeded”,
“PrivateIpAddressVersion”: “IPv4”,
“LoadBalancerBackendAddressPools”: ,
“LoadBalancerInboundNatRules”: ,
“Primary”: true,
“ApplicationGatewayBackendAddressPools”:
}
]
DnsSettings : {
“DnsServers”: ,
“AppliedDnsServers”: ,
“InternalDomainNameSuffix”:
}
EnableIPForwarding : False
EnableAcceleratedNetworking : False
NetworkSecurityGroup : {
“Id”:
“/subscriptions/53d36695-sdfe-4471-b844-ef2204aeeref/resourceGroups/HKfedDR-ffRG01/providers/Microsoft.Network/networkSecurityGroups/DHKdeva-sdfeCSHA1C1SQL-nsg”
}
Primary : True