Runs a PowerShell or Bat script on one or more cloud computers that run Windows.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecd:RunCommand |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| Type |
string |
Yes |
The type of the script. Valid values:
|
RunPowerShellScript |
| CommandContent |
string |
Yes |
The script content in plaintext or Base64-encoded format. Note
If the script content is Base64-encoded, you must set the |
ipconfig |
| Timeout |
integer |
No |
The script execution timeout, in seconds. Default value: 300. |
3600 |
| ContentEncoding |
string |
No |
The encoding mode of the script content. Note
If you specify a value that is not a valid enumeration member, the system defaults to Valid values:
|
Base64 |
| DesktopId |
array |
Yes |
The IDs of the cloud computers on which to run the script. You can specify up to 50 IDs. |
|
|
string |
No |
The cloud computer ID. |
ecd-7w78ozhjcwa3u**** |
|
| EndUserId |
string |
No |
If you specify this parameter, the command runs with the permissions of the specified end user. Note
This user must have a session history on the cloud computer. This means the user must have logged in after the cloud computer started and their session was not taken over by another user. This parameter is not supported for Linux cloud computers. |
alice |
| CommandRole |
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| InvokeId |
string |
The script execution ID. You can use this ID with the DescribeInvocations operation to query the script's execution status. |
t-hz01qgsqj2n**** |
| RequestId |
string |
The request ID. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
Examples
Success response
JSON format
{
"InvokeId": "t-hz01qgsqj2n****",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.