azure - 无法通过 Azure 门户中的 Powershell 运行命令启用/禁用 VM 的网络接口(interface)

标签 azure powershell networking interface portal

我们需要禁用/启用 azure 虚拟机的网络接口(interface)。 无法通过“运行”命令执行此操作

enter image description here

从互联网上尝试了这个命令,但它总是显示正在运行的脚本

“netsh 接口(interface)设置接口(interface)‘接口(interface)名称’禁用”

有什么方法可以通过门户或 powershell 启用/禁用网络接口(interface)吗?

我知道网络重置的另一种方式,其中需要分配同一网络内的新IP,但这里的要求只是禁用然后仅启用网络接口(interface)。

最佳答案

不,我们无法通过运行命令禁用/启用 azure VM 的网络接口(interface)。

RunPowerShellScript命令用于在Azure VM上运行自定义脚本,而不是启用/禁用Azure VM的网络接口(interface),并且在运行脚本时只能使用列出的命令参数。

当 VM 处于停止状态时,您可以通过转至 Networking 来分离/附加(禁用/启用)Azure VM 网络接口(interface)。 --> Attach/Detach Network Interface如下图所示,来自 Azure 门户的屏幕截图:

enter image description here

关于azure - 无法通过 Azure 门户中的 Powershell 运行命令启用/禁用 VM 的网络接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73483578/

相关文章:

regex - 使用 -match 从字符串中提取美元符号和金额

sockets - 第 2 层中的丢包通知

c# - 缺少队列触发属性

azure - 提高 Azure 表存储批量加载的性能

powershell - 如何更改 Add-Blob Azure cmdlet 的超时值?

azure - 如何判断 New-AzSqlDatabaseImport 何时完成?

java - 是否有一个库可以使服务器请求(GET/POST)变得轻松?

linux - Ubuntu : Reset default routing table

sql - Azure SQL DB : create users with PowerShell, 参数化 SQL 脚本和 Azure Key Vault

azure - 如何在不使用帐户 key 的情况下访问存储帐户 blob 容器?