Runs a PowerShell or batch (.bat) script on Windows cloud desktops.
Operation description
You can use the RunCommand operation to run scripts only on Windows cloud desktops.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region. | cn-hangzhou |
Type | string | Yes | The language of the O&M command. Valid values:
| RunPowerShellScript |
CommandContent | string | Yes | The content of the command. The command content can be plaintext or Base64-encoded. Note
If the command content is Base64-encoded, you must set the ContentEncoding parameter to Base64.
| ipconfig |
Timeout | long | No | The timeout period for the command to run. Unit: seconds. Default value: 60. | 3600 |
ContentEncoding | string | No | The encoding mode of the command content. Valid values:
Default value: PlainText. If the specified value of this parameter is invalid, PlainText is used by default. | Base64 |
DesktopId | array | Yes | The ID of cloud desktop N. Valid values of N: 1 to 50. | |
string | Yes | The ID of the cloud desktop. | ecd-7w78ozhjcwa3u**** | |
EndUserId | string | No | The ID of the end user. If you specify a value, you run the command as the end user that is granted specific permissions. Note: The end user has sessions on a cloud computer. That is, when the cloud computer is started, the end user logs on to an Alibaba Cloud Workspace client and connects to the cloud computer, and the cloud computer is not preempted by another end user during the connection. This parameter is not available for Linux cloud computers. | User1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"InvokeId": "t-hz01qgsqj2n****",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-08-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2022-09-29 | The request parameters of the API has changed | View Change Details |