Reputation: 101
We have a requirement to disable/enable the network interface of the azure VM. Not able to do it from the Run command
Tried this command from the internet but it is always showing a running script
" netsh interface set interface 'INTERFACE NAME' disable"
Is there any way we can enable/disable the network interface through the portal or powershell?
I know the other way that network reset in which new ip within the same network needs to be assigned but here the requirement is only to disable and then enable the network interface only.
Upvotes: 0
Views: 716
Reputation: 1389
No, we cannot disable/enable the network interface of the azure VM from the Run command.
RunPowerShellScript command is used to run custom script on Azure VM not to enable/disable the network interface of azure VM and only the listed command parameters can be used while running the script.
You can detach/attach(disable/enable) the Azure VM Network Interface when the VM is in stopped state by going to the Networking
-->Attach/Detach Network Interface
as shown in below Screenshot from the Azure portal:
Upvotes: 1