Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Trigger a Cloud PC organization action.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
CloudPC.ReadWrite.All |
Not available. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
Not supported. |
Not supported. |
HTTP request
To trigger a Cloud PC organization action using delegated permission:
POST /deviceManagement/virtualEndpoint/organizationAction
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameter that you can use with this action.
| Parameter |
Type |
Description |
| actionType |
cloudPcOrganizationActionType |
The action type. Possible values are activate, deactivate, and unknownFutureValue. Required. |
Response
If successful, this method returns a 200 OK response code and a cloudPcOrganizationActionDetail object in the response body.
Example
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/organizationAction
Content-Type: application/json
{
"actionType": "activate"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.OrganizationAction;
using Microsoft.Graph.Beta.Models;
var requestBody = new OrganizationActionPostRequestBody
{
ActionType = CloudPcOrganizationActionType.Activate,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.VirtualEndpoint.OrganizationAction.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphdevicemanagement "github.com/microsoftgraph/msgraph-beta-sdk-go/devicemanagement"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphdevicemanagement.NewOrganizationActionPostRequestBody()
actionType := graphmodels.ACTIVATE_CLOUDPCORGANIZATIONACTIONTYPE
requestBody.SetActionType(&actionType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
organizationAction, err := graphClient.DeviceManagement().VirtualEndpoint().OrganizationAction().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.devicemanagement.virtualendpoint.organizationaction.OrganizationActionPostRequestBody organizationActionPostRequestBody = new com.microsoft.graph.beta.devicemanagement.virtualendpoint.organizationaction.OrganizationActionPostRequestBody();
organizationActionPostRequestBody.setActionType(CloudPcOrganizationActionType.Activate);
var result = graphClient.deviceManagement().virtualEndpoint().organizationAction().post(organizationActionPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcOrganizationActionDetail = {
actionType: 'activate'
};
await client.api('/deviceManagement/virtualEndpoint/organizationAction')
.version('beta')
.post(cloudPcOrganizationActionDetail);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\DeviceManagement\VirtualEndpoint\OrganizationAction\OrganizationActionPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\CloudPcOrganizationActionType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OrganizationActionPostRequestBody();
$requestBody->setActionType(new CloudPcOrganizationActionType('activate'));
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->organizationAction()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.devicemanagement.virtualendpoint.organization_action.organization_action_post_request_body import OrganizationActionPostRequestBody
from msgraph_beta.generated.models.cloud_pc_organization_action_type import CloudPcOrganizationActionType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OrganizationActionPostRequestBody(
action_type = CloudPcOrganizationActionType.Activate,
)
result = await graph_client.device_management.virtual_endpoint.organization_action.post(request_body)
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.cloudPcOrganizationActionDetail",
"actionType": "activate",
"status": "inProgress",
"errorDescription": null
}