Dela via


Virtual Machine Run Commands - List

Visar en lista över alla tillgängliga körningskommandon för en prenumeration på en plats.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands?api-version=2024-07-01

URI-parametrar

Name I Obligatorisk Typ Description
location
path True

string

Platsen där körningskommandon efterfrågas.

Reguljärt uttrycksmönster: ^[-\w\._]+$

subscriptionId
path True

string

Prenumerationsautentiseringsuppgifter som unikt identifierar Microsoft Azure-prenumeration. Prenumerations-ID:t utgör en del av URI:n för varje tjänstanrop.

api-version
query True

string

Klient-API-version.

Svar

Name Typ Description
200 OK

RunCommandListResult

OKEJ

Media Types: "application/json", "text/json"

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

Typ: oauth2
Flow: implicit
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize

Omfattningar

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

VirtualMachineRunCommandList

Exempelbegäran

GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Compute/locations/SoutheastAsia/runCommands?api-version=2024-07-01

Exempelsvar

{
  "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."
    }
  ]
}

Definitioner

Name Description
OperatingSystemTypes

Typ av operativsystem.

RunCommandDocumentBase

Beskriver egenskaperna för en Körningskommandometadata.

RunCommandListResult

Åtgärdssvaret Lista virtuell dator.

OperatingSystemTypes

Typ av operativsystem.

Name Typ Description
Linux

string

Windows

string

RunCommandDocumentBase

Beskriver egenskaperna för en Körningskommandometadata.

Name Typ Description
$schema

string

Kommandoschemat kör den virtuella datorn.

description

string

Kommandobeskrivningen kör den virtuella datorn.

id

string

Kommando-ID:t för den virtuella datorn körs.

label

string

Kommandoetiketten kör den virtuella datorn.

osType

OperatingSystemTypes

Typ av operativsystem.

RunCommandListResult

Åtgärdssvaret Lista virtuell dator.

Name Typ Description
nextLink

string

URI:n för att hämta nästa sida med körningskommandon. Anropa ListNext() med detta för att hämta nästa sida med körningskommandon.

value

RunCommandDocumentBase[]

Listan över virtuella datorkörningskommandon.