你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Virtual Machine Run Commands - List
列出某个位置中订阅的所有可用运行命令。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands?api-version=2024-07-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
location
|
path | True |
string pattern: ^[-\w\._]+$ |
查询运行命令的位置。 |
subscription
|
path | True |
string |
唯一标识 azure 订阅Microsoft的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
还行 Media Types: "application/json", "text/json" |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
VirtualMachineRunCommandList
示例请求
示例响应
{
"value": [
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "EnableRemotePS",
"osType": "Windows",
"label": "Enable remote PowerShell",
"description": "Configure the machine to enable remote PowerShell."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "IPConfig",
"osType": "Windows",
"label": "List IP configuration",
"description": "Shows detailed information for the IP address, subnet mask and default gateway for each adapter bound to TCP/IP."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "RunPowerShellScript",
"osType": "Windows",
"label": "Executes a PowerShell script",
"description": "Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "RunShellScript",
"osType": "Linux",
"label": "Executes a Linux shell script",
"description": "Custom multiline shell script should be defined in script property. Optional parameters can be set in parameters property."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "ifconfig",
"osType": "Linux",
"label": "List network configuration",
"description": "Get the configuration of all network interfaces."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "EnableAdminAccount",
"osType": "Windows",
"label": "Enable administrator account",
"description": "Checks if the local Administrator account is disabled, and if so enables it."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "ResetAccountPassword",
"osType": "Windows",
"label": "Reset built-in Administrator account password",
"description": "Reset built-in Administrator account password."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "RDPSettings",
"osType": "Windows",
"label": "Verify RDP Listener Settings",
"description": "Checks registry settings and domain policy settings. Suggests policy actions if machine is part of a domain or modifies the settings to default values."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "SetRDPPort",
"osType": "Windows",
"label": "Set Remote Desktop port",
"description": "Sets the default or user specified port number for Remote Desktop connections. Enables firewall rule for inbound access to the port."
},
{
"$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
"id": "ResetRDPCert",
"osType": "Windows",
"label": "Restore RDP Authentication mode to defaults",
"description": "Removes the SSL certificate tied to the RDP listener and restores the RDP listerner security to default. Use this script if you see any issues with the certificate."
}
]
}
定义
名称 | 说明 |
---|---|
Operating |
操作系统类型。 |
Run |
描述 Run Command 元数据的属性。 |
Run |
列出虚拟机操作响应。 |
OperatingSystemTypes
操作系统类型。
值 | 说明 |
---|---|
Linux | |
Windows |
RunCommandDocumentBase
描述 Run Command 元数据的属性。
名称 | 类型 | 说明 |
---|---|---|
$schema |
string |
VM 运行命令架构。 |
description |
string |
VM 运行命令说明。 |
id |
string |
VM 运行命令 ID。 |
label |
string |
VM 运行命令标签。 |
osType |
操作系统类型。 |
RunCommandListResult
列出虚拟机操作响应。
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
用于提取下一页的运行命令的 URI。 调用 ListNext()以提取下一页的运行命令。 |
value |
虚拟机运行命令的列表。 |