cloudPcOnPremisesConnection: updateAdDomainPassword
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
更新 cloudPcOnPremisesConnection 对象的 Active Directory 域密码。 当 cloudPcOnPremisesConnection 对象的类型为 hybridAzureADJoin 时,支持此 API。
重要
本地网络连接 已重命名为 Azure 网络连接 。 此处 的 cloudPcOnPremisesConnection 对象等效于云电脑产品的 Azure 网络连接 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
CloudPC.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
CloudPC.ReadWrite.All
HTTP 请求
注意
此操作的 PATCH 语法已弃用,将在 2022 年 6 月之后停止工作。 我们建议你今后使用 POST。
POST /deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword
PATCH /deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword
名称
说明
Authorization
Bearer {token}。必需。
Content-Type
application/json. Required.
请求正文
在请求正文中,提供参数的 JSON 表示形式。
下表显示了可用于此操作的参数。
参数
类型
说明
adDomainPassword
String
与 adDomainUsername 关联的密码。
响应
如果成功,此操作返回 204 No Content 响应代码。
示例
请求
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword
Content-Type: application/json
{
"adDomainPassword": "AdDomainPassword value"
}
const options = {
authProvider,
};
const client = Client.init(options);
const updateAdDomainPassword = {
adDomainPassword: 'AdDomainPassword value'
};
await client.api('/deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword')
.version('beta')
.update(updateAdDomainPassword);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSString *adDomainPassword = @"AdDomainPassword value";
payloadDictionary[@"adDomainPassword"] = adDomainPassword;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
requestBody.SetAdditionalData(map[string]interface{}{
"adDomainPassword": "AdDomainPassword value",
}
cloudPcOnPremisesConnectionId := "cloudPcOnPremisesConnection-id"
graphClient.DeviceManagement().VirtualEndpoint().OnPremisesConnectionsById(&cloudPcOnPremisesConnectionId).UpdateAdDomainPassword(cloudPcOnPremisesConnection-id).Patch(requestBody)
响应
HTTP/1.1 204 No Content