Skip to content

Commit 54fd992

Browse files
authored
Merge pull request #58178 from genlin/master105
reset-network-interface.md
2 parents 4c5853d + 916af23 commit 54fd992

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

articles/virtual-machines/troubleshooting/reset-network-interface.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags: top-support-issue, azure-resource-manager
1111
ms.service: virtual-machines-windows
1212
ms.tgt_pltfrm: vm-windows
1313
ms.topic: troubleshooting
14-
ms.date: 10/31/2018
14+
ms.date: 11/16/2018
1515
ms.author: genli
1616

1717
---
@@ -28,6 +28,8 @@ You cannot connect to Microsoft Azure Windows Virtual Machine (VM) after you dis
2828

2929
To reset network interface, follow these steps:
3030

31+
#### Use Azure portal
32+
3133
1. Go to the [Azure portal]( https://ms.portal.azure.com).
3234
2. Select **Virtual Machines (Classic)**.
3335
3. Select the affected Virtual Machine.
@@ -38,6 +40,31 @@ To reset network interface, follow these steps:
3840
8. The virtual machine will restart to initialize the new NIC to the system.
3941
9. Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.
4042

43+
#### Use Azure PowerShell
44+
45+
1. Make sure that you have [the latest Azure PowerShell](https://docs.microsoft.com/powershell/azure/overview) installed.
46+
2. Open an elevated Azure PowerShell session (Run as administrator). Run the following commands:
47+
48+
```powershell
49+
#Set the variables
50+
$SubscriptionID = "<Suscription ID>"​
51+
$VM = "<VM Name>"
52+
$CloudService = "<Cloud Service>"
53+
$VNET = "<Virtual Network>"
54+
$IP = "NEWIP"
55+
56+
#Log in to the subscription​
57+
Add-AzureAccount
58+
Select-AzureSubscription -SubscriptionId $SubscriptionId 
59+
60+
#Check whether the new IP address is available in the virtual network.
61+
Test-AzureStaticVNetIP –VNetName $VNET –IPAddress $IP
62+
63+
#Add/Change static IP. This process will not change MAC address
64+
Get-AzureVM -ServiceName $CloudService -Name $VM | Set-AzureStaticVNetIP -IPAddress $IP |Update-AzureVM
65+
```
66+
3. Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.
67+
4168
### For VMs deployed in Resource group model
4269
4370
1. Go to the [Azure portal]( https://ms.portal.azure.com).
@@ -51,6 +78,31 @@ To reset network interface, follow these steps:
5178
9. The virtual machine will restart to initialize the new NIC to the system.
5279
10. Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.
5380
81+
#### Use Azure PowerShell
82+
83+
1. Make sure that you have [the latest Azure PowerShell](https://docs.microsoft.com/powershell/azure/overview) installed
84+
2. Open an elevated Azure PowerShell session (Run as administrator). Run the following commands:
85+
86+
```powershell
87+
#Set the variables
88+
$SubscriptionID = "<Suscription ID>"​
89+
$VM = "<VM Name>"
90+
$ResourceGroup = "<Resource Group>"
91+
$VNET = "<Virtual Network>"
92+
$IP = "NEWIP"
93+
94+
#Log in to the subscription​
95+
Add-AzureRMAccount
96+
Select-AzureRMSubscription -SubscriptionId $SubscriptionId 
97+
98+
#Check whether the new IP address is available in the virtual network.
99+
Test-AzureStaticVNetIP –VNetName $VNET –IPAddress $IP
100+
101+
#Add/Change static IP. This process will not change MAC address
102+
Get-AzureRMVM -ServiceName $ResourceGroup -Name $VM | Set-AzureStaticVNetIP -IPAddress $IP | Update-AzureRMVM
103+
```
104+
3. Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.
105+
54106
## Delete the unavailable NICs
55107
After you can remote desktop to the machine, you must delete the old NICs to avoid the potential problem:
56108

0 commit comments

Comments
 (0)