命名空间:microsoft.graph
获取 bitlockerRecoveryKey 对象及其属性的列表。
此操作不返回 键 属性。 有关如何读取 密钥 属性的信息,请参阅 获取 bitlockerRecoveryKey。
可以使用此 API 以编程方式循环访问租户中的恢复密钥列表,并识别启用了 BitLocker 的设备。 有关详细信息,请参阅 BitLocker 恢复过程中的示例 PowerShell 代码。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
BitlockerKey.ReadBasic.All |
BitlockerKey.Read.All |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
BitlockerKey.ReadBasic.All |
BitlockerKey.Read.All |
重要
对于委托的权限,调用用户必须是最初备份 BitLocker 恢复密钥的设备注册所有者,或者必须为他们分配受支持的Microsoft Entra角色。此操作支持以下最低特权角色。
- 云设备管理员
- 支持人员管理员
- Intune 服务管理员
- 安全管理员
- 安全读者
- 全局读取者
HTTP 请求
若要获取租户中的 BitLocker 密钥列表,请执行以下操作:
GET /informationProtection/bitlocker/recoveryKeys
可选的查询参数
此方法支持 $filter
OData 查询参数,以按密钥最近备份到的设备的 deviceId 筛选结果。 此方法不支持 $top
。 若要了解一般信息,请参阅 OData 查询参数。
响应可能还包含 , odata.nextLink
可用于分页浏览结果集。 有关详细信息,请参阅 分页Microsoft图形数据。
名称 |
说明 |
Authorization |
持有者 {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
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync((requestConfiguration) =>
{
requestConfiguration.Headers.Add("User-Agent", "Dsreg/10.0");
requestConfiguration.Headers.Add("ocp-client-name", "My Friendly Client");
requestConfiguration.Headers.Add("ocp-client-version", "1.2");
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphinformationprotection "github.com/microsoftgraph/msgraph-sdk-go/informationprotection"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("User-Agent", "Dsreg/10.0")
headers.Add("ocp-client-name", "My Friendly Client")
headers.Add("ocp-client-version", "1.2")
configuration := &graphinformationprotection.BitlockerRecoveryKeysRequestBuilderGetRequestConfiguration{
Headers: headers,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
recoveryKeys, err := graphClient.InformationProtection().Bitlocker().RecoveryKeys().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BitlockerRecoveryKeyCollectionResponse result = graphClient.informationProtection().bitlocker().recoveryKeys().get(requestConfiguration -> {
requestConfiguration.headers.add("User-Agent", "Dsreg/10.0");
requestConfiguration.headers.add("ocp-client-name", "My Friendly Client");
requestConfiguration.headers.add("ocp-client-version", "1.2");
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let recoveryKeys = await client.api('/informationProtection/bitlocker/recoveryKeys')
.header('User-Agent','Dsreg/10.0')
.header('ocp-client-name','My Friendly Client')
.header('ocp-client-version','1.2')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\InformationProtection\Bitlocker\RecoveryKeys\RecoveryKeysRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new RecoveryKeysRequestBuilderGetRequestConfiguration();
$headers = [
'User-Agent' => 'Dsreg/10.0',
'ocp-client-name' => 'My Friendly Client',
'ocp-client-version' => '1.2',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->informationProtection()->bitlocker()->recoveryKeys()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.SignIns
Get-MgInformationProtectionBitlockerRecoveryKey
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.information_protection.bitlocker.recovery_keys.recovery_keys_request_builder import RecoveryKeysRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_configuration = RequestConfiguration()
request_configuration.headers.add("User-Agent", "Dsreg/10.0")
request_configuration.headers.add("ocp-client-name", "My Friendly Client")
request_configuration.headers.add("ocp-client-version", "1.2")
result = await graph_client.information_protection.bitlocker.recovery_keys.get(request_configuration = request_configuration)
有关如何将 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
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.InformationProtection.Bitlocker.RecoveryKeys.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'";
requestConfiguration.Headers.Add("User-Agent", "Dsreg/10.0");
requestConfiguration.Headers.Add("ocp-client-name", "My Friendly Client");
requestConfiguration.Headers.Add("ocp-client-version", "1.2");
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc information-protection bitlocker recovery-keys list --filter "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphinformationprotection "github.com/microsoftgraph/msgraph-sdk-go/informationprotection"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("User-Agent", "Dsreg/10.0")
headers.Add("ocp-client-name", "My Friendly Client")
headers.Add("ocp-client-version", "1.2")
requestFilter := "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'"
requestParameters := &graphinformationprotection.BitlockerRecoveryKeysRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphinformationprotection.BitlockerRecoveryKeysRequestBuilderGetRequestConfiguration{
Headers: headers,
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
recoveryKeys, err := graphClient.InformationProtection().Bitlocker().RecoveryKeys().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BitlockerRecoveryKeyCollectionResponse result = graphClient.informationProtection().bitlocker().recoveryKeys().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'";
requestConfiguration.headers.add("User-Agent", "Dsreg/10.0");
requestConfiguration.headers.add("ocp-client-name", "My Friendly Client");
requestConfiguration.headers.add("ocp-client-version", "1.2");
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let recoveryKeys = await client.api('/informationProtection/bitlocker/recoveryKeys')
.header('User-Agent','Dsreg/10.0')
.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 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\InformationProtection\Bitlocker\RecoveryKeys\RecoveryKeysRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new RecoveryKeysRequestBuilderGetRequestConfiguration();
$headers = [
'User-Agent' => 'Dsreg/10.0',
'ocp-client-name' => 'My Friendly Client',
'ocp-client-version' => '1.2',
];
$requestConfiguration->headers = $headers;
$queryParameters = RecoveryKeysRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->informationProtection()->bitlocker()->recoveryKeys()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.SignIns
Get-MgInformationProtectionBitlockerRecoveryKey -Filter "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.information_protection.bitlocker.recovery_keys.recovery_keys_request_builder import RecoveryKeysRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = RecoveryKeysRequestBuilder.RecoveryKeysRequestBuilderGetQueryParameters(
filter = "deviceId eq '1ab40ab2-32a8-4b00-b6b5-ba724e407de9'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
request_configuration.headers.add("User-Agent", "Dsreg/10.0")
request_configuration.headers.add("ocp-client-name", "My Friendly Client")
request_configuration.headers.add("ocp-client-version", "1.2")
result = await graph_client.information_protection.bitlocker.recovery_keys.get(request_configuration = request_configuration)
有关如何将 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"
}
]
}