L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceManagementExchangeConnector
{
OdataType = "#microsoft.graph.deviceManagementExchangeConnector",
LastSyncDateTime = DateTimeOffset.Parse("2017-01-01T00:02:49.3205976-08:00"),
Status = DeviceManagementExchangeConnectorStatus.ConnectionPending,
PrimarySmtpAddress = "Primary Smtp Address value",
ServerName = "Server Name value",
ConnectorServerName = "Connector Server Name value",
ExchangeConnectorType = DeviceManagementExchangeConnectorType.Hosted,
Version = "Version value",
ExchangeAlias = "Exchange Alias value",
ExchangeOrganization = "Exchange Organization value",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.ExchangeConnectors["{deviceManagementExchangeConnector-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceManagementExchangeConnector deviceManagementExchangeConnector = new DeviceManagementExchangeConnector();
deviceManagementExchangeConnector.setOdataType("#microsoft.graph.deviceManagementExchangeConnector");
OffsetDateTime lastSyncDateTime = OffsetDateTime.parse("2017-01-01T00:02:49.3205976-08:00");
deviceManagementExchangeConnector.setLastSyncDateTime(lastSyncDateTime);
deviceManagementExchangeConnector.setStatus(DeviceManagementExchangeConnectorStatus.ConnectionPending);
deviceManagementExchangeConnector.setPrimarySmtpAddress("Primary Smtp Address value");
deviceManagementExchangeConnector.setServerName("Server Name value");
deviceManagementExchangeConnector.setConnectorServerName("Connector Server Name value");
deviceManagementExchangeConnector.setExchangeConnectorType(DeviceManagementExchangeConnectorType.Hosted);
deviceManagementExchangeConnector.setVersion("Version value");
deviceManagementExchangeConnector.setExchangeAlias("Exchange Alias value");
deviceManagementExchangeConnector.setExchangeOrganization("Exchange Organization value");
DeviceManagementExchangeConnector result = graphClient.deviceManagement().exchangeConnectors().byDeviceManagementExchangeConnectorId("{deviceManagementExchangeConnector-id}").patch(deviceManagementExchangeConnector);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\DeviceManagementExchangeConnector;
use Microsoft\Graph\Generated\Models\DeviceManagementExchangeConnectorStatus;
use Microsoft\Graph\Generated\Models\DeviceManagementExchangeConnectorType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DeviceManagementExchangeConnector();
$requestBody->setOdataType('#microsoft.graph.deviceManagementExchangeConnector');
$requestBody->setLastSyncDateTime(new \DateTime('2017-01-01T00:02:49.3205976-08:00'));
$requestBody->setStatus(new DeviceManagementExchangeConnectorStatus('connectionPending'));
$requestBody->setPrimarySmtpAddress('Primary Smtp Address value');
$requestBody->setServerName('Server Name value');
$requestBody->setConnectorServerName('Connector Server Name value');
$requestBody->setExchangeConnectorType(new DeviceManagementExchangeConnectorType('hosted'));
$requestBody->setVersion('Version value');
$requestBody->setExchangeAlias('Exchange Alias value');
$requestBody->setExchangeOrganization('Exchange Organization value');
$result = $graphServiceClient->deviceManagement()->exchangeConnectors()->byDeviceManagementExchangeConnectorId('deviceManagementExchangeConnector-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_management_exchange_connector import DeviceManagementExchangeConnector
from msgraph.generated.models.device_management_exchange_connector_status import DeviceManagementExchangeConnectorStatus
from msgraph.generated.models.device_management_exchange_connector_type import DeviceManagementExchangeConnectorType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceManagementExchangeConnector(
odata_type = "#microsoft.graph.deviceManagementExchangeConnector",
last_sync_date_time = "2017-01-01T00:02:49.3205976-08:00",
status = DeviceManagementExchangeConnectorStatus.ConnectionPending,
primary_smtp_address = "Primary Smtp Address value",
server_name = "Server Name value",
connector_server_name = "Connector Server Name value",
exchange_connector_type = DeviceManagementExchangeConnectorType.Hosted,
version = "Version value",
exchange_alias = "Exchange Alias value",
exchange_organization = "Exchange Organization value",
)
result = await graph_client.device_management.exchange_connectors.by_device_management_exchange_connector_id('deviceManagementExchangeConnector-id').patch(request_body)
Voici un exemple de réponse. Remarque : l’objet de réponse illustré ici peut être tronqué à des fins de concision. Toutes les propriétés sont renvoyées à partir d’un appel réel.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 539
{
"@odata.type": "#microsoft.graph.deviceManagementExchangeConnector",
"id": "e11c1de8-1de8-e11c-e81d-1ce1e81d1ce1",
"lastSyncDateTime": "2017-01-01T00:02:49.3205976-08:00",
"status": "connectionPending",
"primarySmtpAddress": "Primary Smtp Address value",
"serverName": "Server Name value",
"connectorServerName": "Connector Server Name value",
"exchangeConnectorType": "hosted",
"version": "Version value",
"exchangeAlias": "Exchange Alias value",
"exchangeOrganization": "Exchange Organization value"
}