gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 06:52:18 25 4
gpt4 key购买 nike

我们需要禁用/启用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com