Get-AzNetworkInterface
Obtém uma interface de rede.
Sintaxe
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
O cmdlet Get-AzNetworkInterface obtém um adaptador de rede do Azure ou uma lista de adaptadores de rede do Azure em um grupo de recursos.
Exemplos
Exemplo 1: Obter todas as interfaces de rede
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 :
Esse comando obtém todos os adaptadores de rede para a assinatura atual.
Exemplo 2: Obter todos os adaptadores de rede com um estado de provisionamento 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 :
Esse comando obtém todos os adaptadores de rede no grupo de recursos chamado ResourceGroup1 que tem um estado de provisionamento bem-sucedido.
Exemplo 3: Obter adaptadores de rede usando filtragem
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 :
Esse comando obtém todas as interfaces de rede para a assinatura atual que começam com "test".
Parâmetros
-DefaultProfile
As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.
Tipo: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | False |
Aceitar a entrada de pipeline: | False |
Aceitar caracteres curinga: | False |
-ExpandResource
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | False |
-Name
Especifica o nome do adaptador de rede que esse cmdlet obtém.
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | True |
-ResourceGroupName
Especifica o nome do grupo de recursos do qual esse cmdlet obtém adaptadores de rede.
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | True |
-ResourceId
A ID do gerenciador de recursos do Azure do adaptador de rede.
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | False |
-VirtualMachineIndex
Especifica o índice da máquina virtual do conjunto de dimensionamento de máquinas virtuais do qual esse cmdlet obtém adaptadores de rede.
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | False |
-VirtualMachineScaleSetName
Especifica o nome do conjunto de dimensionamento de máquinas virtuais do qual esse cmdlet obtém adaptadores de rede.
Tipo: | String |
Cargo: | Named |
Valor padrão: | None |
Obrigatório: | True |
Aceitar a entrada de pipeline: | True |
Aceitar caracteres curinga: | False |