Get-AzNetworkInterface
Obtiene una interfaz de red.
Sintaxis
Get-AzNetworkInterface
[-Name <String>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzNetworkInterface
-Name <String>
-ResourceGroupName <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzNetworkInterface
[-Name <String>]
-ResourceGroupName <String>
[-VirtualMachineScaleSetName <String>]
[-VirtualMachineIndex <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzNetworkInterface
-Name <String>
-ResourceGroupName <String>
-VirtualMachineScaleSetName <String>
-VirtualMachineIndex <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzNetworkInterface
-ResourceId <String>
-ExpandResource <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzNetworkInterface
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
El cmdlet Get-AzNetworkInterface obtiene una interfaz de red de Azure o una lista de interfaces de red de Azure en un grupo de recursos.
Ejemplos
Ejemplo 1: Obtener todas las interfaces de red
Get-AzNetworkInterface
Name : test1
ResourceGroupName : ResourceGroup1
Location : eastus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Micros
oft.Network/networkInterfaces/test1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
VirtualMachine : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Compute/virtualMachines/test1"
}
IpConfigurations : [
{
"Name": "test1",
"Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provi
ders/Microsoft.Network/networkInterfaces/test1/ipConfigurations/test1",
"PrivateIpAddress": "x.x.x.x",
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Delegations": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/virtualNetworks/test1/subnets/test1",
"ServiceAssociationLinks": []
},
"PublicIpAddress": {
"IpTags": [],
"Zones": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/publicIPAddresses/test1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAddressVersion": "IPv4",
"LoadBalancerBackendAddressPools": [],
"LoadBalancerInboundNatRules": [],
"Primary": true,
"ApplicationGatewayBackendAddressPools": [],
"ApplicationSecurityGroups": []
}
]
DnsSettings : {
"DnsServers": [],
"AppliedDnsServers": []
}
EnableIPForwarding : False
EnableAcceleratedNetworking : False
NetworkSecurityGroup : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Network/networkSecurityGroups/test1"
}
Primary : True
MacAddress :
Este comando obtiene todas las interfaces de red de la suscripción actual.
Ejemplo 2: Obtención de todas las interfaces de red con un estado de aprovisionamiento específico
Get-AzNetworkInterface -ResourceGroupName "ResourceGroup1" | Where-Object {$_.ProvisioningState -eq 'Succeeded'}
Name : test1
ResourceGroupName : ResourceGroup1
Location : eastus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Micros
oft.Network/networkInterfaces/test1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
VirtualMachine : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Compute/virtualMachines/test1"
}
IpConfigurations : [
{
"Name": "test1",
"Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provi
ders/Microsoft.Network/networkInterfaces/test1/ipConfigurations/test1",
"PrivateIpAddress": "x.x.x.x",
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Delegations": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/virtualNetworks/test1/subnets/test1",
"ServiceAssociationLinks": []
},
"PublicIpAddress": {
"IpTags": [],
"Zones": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/publicIPAddresses/test1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAddressVersion": "IPv4",
"LoadBalancerBackendAddressPools": [],
"LoadBalancerInboundNatRules": [],
"Primary": true,
"ApplicationGatewayBackendAddressPools": [],
"ApplicationSecurityGroups": []
}
]
DnsSettings : {
"DnsServers": [],
"AppliedDnsServers": []
}
EnableIPForwarding : False
EnableAcceleratedNetworking : False
NetworkSecurityGroup : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Network/networkSecurityGroups/test1"
}
Primary : True
MacAddress :
Este comando obtiene todas las interfaces de red del grupo de recursos denominado ResourceGroup1 que tiene un estado de aprovisionamiento correcto.
Ejemplo 3: Obtención de interfaces de red mediante el filtrado
Get-AzNetworkInterface -Name test*
Name : test1
ResourceGroupName : ResourceGroup1
Location : eastus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/providers/Micros
oft.Network/networkInterfaces/test1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
VirtualMachine : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Compute/virtualMachines/test1"
}
IpConfigurations : [
{
"Name": "test1",
"Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provi
ders/Microsoft.Network/networkInterfaces/test1/ipConfigurations/test1",
"PrivateIpAddress": "x.x.x.x",
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Delegations": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/virtualNetworks/test1/subnets/test1",
"ServiceAssociationLinks": []
},
"PublicIpAddress": {
"IpTags": [],
"Zones": [],
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/pro
viders/Microsoft.Network/publicIPAddresses/test1"
},
"ProvisioningState": "Succeeded",
"PrivateIpAddressVersion": "IPv4",
"LoadBalancerBackendAddressPools": [],
"LoadBalancerInboundNatRules": [],
"Primary": true,
"ApplicationGatewayBackendAddressPools": [],
"ApplicationSecurityGroups": []
}
]
DnsSettings : {
"DnsServers": [],
"AppliedDnsServers": []
}
EnableIPForwarding : False
EnableAcceleratedNetworking : False
NetworkSecurityGroup : {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup1/provide
rs/Microsoft.Network/networkSecurityGroups/test1"
}
Primary : True
MacAddress :
Este comando obtiene todas las interfaces de red de la suscripción actual que comienzan por "test".
Parámetros
-DefaultProfile
Las credenciales, la cuenta, el inquilino y la suscripción que se usan para la comunicación con Azure.
Tipo: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-ExpandResource
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-Name
Especifica el nombre de la interfaz de red que obtiene este cmdlet.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | True |
-ResourceGroupName
Especifica el nombre del grupo de recursos del que este cmdlet obtiene interfaces de red.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | True |
-ResourceId
Identificador de Azure Resource Manager de la interfaz de red.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-VirtualMachineIndex
Especifica el índice de máquina virtual del conjunto de escalado de máquinas virtuales desde el que este cmdlet obtiene interfaces de red.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-VirtualMachineScaleSetName
Especifica el nombre del conjunto de escalado de máquinas virtuales desde el que este cmdlet obtiene interfaces de red.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |