列出 recoveryKeys
命名空间:microsoft.graph
获取 bitlockerRecoveryKey 对象及其属性的列表。
此操作不会返回 key 属性。 若要了解如何读取 key 属性,请参阅获取 bitlockerRecoveryKey。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最高特权到最低特权) |
| 委派(工作或学校帐户) |
BitLockerKey.ReadBasic.All、BitLockerKey.Read.All |
| 委派(个人 Microsoft 帐户) |
不支持 |
| 应用程序 |
不支持 |
对于委派权限,调用用户必须是最初备份 BitLocker 恢复密钥的设备注册所有者,或者他们必须具有以下目录角色 之一:
- 全局管理员
- 云设备管理员
- 支持人员管理员
- Intune 服务管理员
- 安全管理员
- 安全读者
- 全局读取者
HTTP 请求
若要获取租户内的 BitLocker 密钥列表,请进行以下操作:
GET /informationProtection/bitlocker/recoveryKeys
可选的查询参数
此方法支持 $filter OData 查询参数,以按最近备份密钥的设备的 deviceId 筛选结果。 此方法不支持 $top。 若要了解一般信息,请参阅 OData 查询参数。
该响应可能还包含 odata.nextLink,您可以使用 它分页浏览结果集。 有关详细信息,请参阅分页 Microsoft Graph数据。
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
| User-Agent |
调用应用程序的标识符。 此值包含有关使用的操作系统和浏览器的信息。 必需项。 |
| ocp-client-name |
执行 API 调用的客户端应用程序的名称。 此标头用于调试目的。 可选。 |
| ocp-client-version |
执行 API 调用的客户端应用程序的版本。 此标头用于调试目的。 可选。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应 200 OK 正文中返回 响应代码和 bitlockerRecoveryKey 对象集合。
示例
示例 1:检索租户中的 BitLocker 密钥列表。
请求
下面展示了示例请求。
GET https://graph.microsoft.com/v1.0/informationProtection/bitlocker/recoveryKeys
User-Agent: "Dsreg/10.0 (Windows 10.0.19043.1466)"
ocp-client-name: "My Friendly Client"
ocp-client-version: "1.2"
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var recoveryKeys = await graphClient.InformationProtection.Bitlocker.RecoveryKeys
.Request()
.Header("ocp-client-name","\"My Friendly Client\"")
.Header("ocp-client-version","\"1.2\"")
.GetAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let recoveryKeys = await client.api('/informationProtection/bitlocker/recoveryKeys')
.header('ocp-client-name','"My Friendly Client"')
.header('ocp-client-version','"1.2"')
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/informationProtection/bitlocker/recoveryKeys"]]];
[urlRequest setHTTPMethod:@"GET"];
[urlRequest setValue:@"\"My Friendly Client\"" forHTTPHeaderField:@"ocp-client-name"];
[urlRequest setValue:@"\"1.2\"" forHTTPHeaderField:@"ocp-client-version"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphBitlockerRecoveryKey *bitlockerRecoveryKey = [[MSGraphBitlockerRecoveryKey alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("ocp-client-name", "\"My Friendly Client\""));
requestOptions.add(new HeaderOption("ocp-client-version", "\"1.2\""));
BitlockerRecoveryKeyCollectionPage recoveryKeys = graphClient.informationProtection().bitlocker().recoveryKeys()
.buildRequest( requestOptions )
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
headers := map[string]string{
"ocp-client-name": ""My Friendly Client""
"ocp-client-version": ""1.2""
}
options := &msgraphsdk.RecoveryKeysRequestBuilderGetOptions{
H: headers,
}
result, err := graphClient.InformationProtection().Bitlocker().RecoveryKeys().Get(options)
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.bitlockerRecoveryKey",
"id": "b465e4e8-e4e8-b465-e8e4-65b4e8e465b4",
"createdDateTime": "2020-06-15T13:45:30.0000000Z",
"volumeType": "1",
"deviceId": "2ef04ef1-23b0-2e00-a3a5-ab345e567ab6"
},
{
"@odata.type": "#microsoft.graph.bitlockerRecoveryKey",
"id": "6a30ed7b-247b-4d26-86b5-2f405e55ea42",
"createdDateTime": "2020-06-15T13:45:30.0000000Z",
"volumeType": "1",
"deviceId": "1ab40ab2-32a8-4b00-b6b5-ba724e407de9"
}
]
}
示例 2:检索按 deviceId 筛选的 BitLocker 密钥列表。
请求
下面展示了示例请求。
GET https://graph.microsoft.com/v1.0/informationProtection/bitlocker/recoveryKeys?$filter=deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'
User-Agent: "Dsreg/10.0 (Windows 10.0.19043.1466)"
ocp-client-name: "My Friendly Client"
ocp-client-version: "1.2"
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var recoveryKeys = await graphClient.InformationProtection.Bitlocker.RecoveryKeys
.Request()
.Header("ocp-client-name","\"My Friendly Client\"")
.Header("ocp-client-version","\"1.2\"")
.Filter("deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'")
.GetAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let recoveryKeys = await client.api('/informationProtection/bitlocker/recoveryKeys')
.header('ocp-client-name','"My Friendly Client"')
.header('ocp-client-version','"1.2"')
.filter('deviceId eq \'1ab40ab2-32a8-4b00-b6b5-ba724e407de9\'')
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/informationProtection/bitlocker/recoveryKeys?$filter=deviceId%20eq%20'1ab40ab2-32a8-4b00-b6b5-ba724e407de9'"]]];
[urlRequest setHTTPMethod:@"GET"];
[urlRequest setValue:@"\"My Friendly Client\"" forHTTPHeaderField:@"ocp-client-name"];
[urlRequest setValue:@"\"1.2\"" forHTTPHeaderField:@"ocp-client-version"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphBitlockerRecoveryKey *bitlockerRecoveryKey = [[MSGraphBitlockerRecoveryKey alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("ocp-client-name", "\"My Friendly Client\""));
requestOptions.add(new HeaderOption("ocp-client-version", "\"1.2\""));
BitlockerRecoveryKeyCollectionPage recoveryKeys = graphClient.informationProtection().bitlocker().recoveryKeys()
.buildRequest( requestOptions )
.filter("deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'")
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.RecoveryKeysRequestBuilderGetQueryParameters{
Filter: "deviceId%20eq%20'1ab40ab2-32a8-4b00-b6b5-ba724e407de9'",
}
headers := map[string]string{
"ocp-client-name": ""My Friendly Client""
"ocp-client-version": ""1.2""
}
options := &msgraphsdk.RecoveryKeysRequestBuilderGetOptions{
Q: requestParameters,
H: headers,
}
result, err := graphClient.InformationProtection().Bitlocker().RecoveryKeys().Get(options)
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.SignIns
Get-MgInformationProtectionBitlockerRecoveryKey -Filter "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'"
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.bitlockerRecoveryKey",
"id": "b465e4e8-e4e8-b465-e8e4-65b4e8e465b4",
"createdDateTime": "2020-06-15T13:45:30.0000000Z",
"volumeType": "1",
"deviceId": "1ab40ab2-32a8-4b00-b6b5-ba724e407de9"
}
]
}