名前空間: microsoft.graph
重要
Microsoft Graph の /beta
バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
ユーザーの windowsSetting オブジェクトとそのプロパティの一覧を取得します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
委任 (職場または学校のアカウント) |
UserWindowsSettings.ReadWrite.All |
UserWindowsSettings.Read.All |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
サポートされていません。 |
サポートされていません。 |
注:
- 呼び出し元のユーザーには、Microsoft 365 バックアップ AdministratorMicrosoft Entra ロールを割り当てる必要があります。
-
UserWindowsSettings.Read
アクセス許可を使用すると、アプリはサインインしているユーザーのみの設定を読み取ることができます。
-
UserWindowsSettings.Read.All
アクセス許可を使用すると、アプリは特定のユーザーの設定を読み取ることができます。
HTTP 要求
特定のユーザー:
GET /users/{user-id}@{tenant-id}/settings/windows
サインイン ユーザー:
GET /me/settings/windows
オプションのクエリ パラメーター
このメソッドは、応答のカスタマイズに役立つ $filter
OData クエリ パラメーターをサポートします。 一般的な情報については、「OData クエリ パラメーター」を参照してください。
次のプロパティで結果をフィルター処理できます。
-
windowsDeviceId: Windows デバイスの一意の識別子を表す文字列値。 この識別子は、応答本文にあります。
windowsDeviceId でフィルター処理すると、そのデバイスに固有の設定の一覧を取得できます。 このパラメーターでは、等値 (
eq
) 比較のみがサポートされます。
-
settingType: 次の有効な値を持つ列挙体:
roaming
と backup
。
settingType プロパティを使用すると、ローミングまたはバックアップに関連する設定に結果を絞り込みます。 このパラメーターでは、等値 (eq
) 比較のみがサポートされます。 詳細については、「 windowsSettingType」を参照してください。
このクエリ パラメーターの使用方法の詳細については、「例」セクション を 参照してください。
名前 |
説明 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
Prefer |
省略可能。 この API は、改ページのために、このヘッダーを使用して odata.maxpagesize パラメーターをサポートします。
odata.maxpagesize の有効な最小値と最大値はそれぞれ 1 と 200 です。 値が渡されない場合、既定値は 110 です。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK
応答コードと、応答本文の windowsSetting オブジェクトのコレクションを返します。
応答に複数のページのデータが含まれている場合、応答本文には @odata.nextLink
プロパティが含まれます。 このプロパティには、データの次のページを要求するために使用できる URL が含まれます。 URL は変更せずに使用する必要があります。
例
例 1: フィルターなしで要求する
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/me/settings/windows
// 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.Me.Settings.Windows.GetAsync();
mgc-beta users settings windows list --user-id {user-id}
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
windows, err := graphClient.Me().Settings().Windows().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsSettingCollectionResponse result = graphClient.me().settings().windows().get();
const options = {
authProvider,
};
const client = Client.init(options);
let windows = await client.api('/me/settings/windows')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->me()->settings()->windows()->get()->wait();
Import-Module Microsoft.Graph.Beta.Users
# A UPN can also be used as -UserId.
Get-MgBetaUserSettingWindows -UserId $userId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.me.settings.windows.get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "default$windows.data.fileexplorerclassic.searchsettings",
"windowsDeviceId": "c9e0f7d8-2b1a-4f6e-9b7c-8e3a1a3e5b0d",
"settingType": "backup",
"payloadType": "windows.data.fileexplorerclassic.searchsettings",
"instances": [
{
"id": "9715f1d9-49d1-4b94-041b-443ac419d417",
"payload": "VGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUh",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
},
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "default$windows.data.input.devices.pensyncedsettings",
"windowsDeviceId": "a4b9d6e7-8f3c-4d2a-b1e0-6c5f0e9a7d8b",
"settingType": "backup",
"payloadType": "windows.data.input.devices.pensyncedsettings",
"instances": [
{
"id": "666dcb9b-49d1-4b94-041b-443ac419d417",
"payload": "VGhpcyBpcyBhbm90aGVyIGp1c3QgYW4gZXhhbXBsZSE=",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
}
],
"@odata.nextLink": "https://graph.microsoft.com/beta/me/settings/windows?$skiptoken=eyJzZXRhZyI6ImJmY2I2ZjQwLWM5ZGQtMTFlZS05MTE3LTAxMDIwMzA1MDcwZCIsImlldGFnIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIiwiZW5kRVRhZyI6IjEwMDJkOGYwLWM2NTItMTRkYy05MTE3LTAxMDIwMzA1MDcwZCIsImV0YWciOiJjMDMzZjUxMC1jOWRkLTExZWUtOTExNy0wMTAyMDMwNTA3MGQiLCJsdHNsIjoiYzAzM2Y1MTAtYzlkZC0xMWVlLTkxMTctMDEwMjAzMDUwNzBkIiwibmV4dCI6dHJ1ZX0%3d"
}
例 2: roaming
settingType によるフィルターを使用した要求
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/me/settings/windows?$filter=settingType eq 'roaming'
// 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.Me.Settings.Windows.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "settingType eq 'roaming'";
});
mgc-beta users settings windows list --user-id {user-id} --filter "settingType eq 'roaming'"
// 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"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
//other-imports
)
requestFilter := "settingType eq 'roaming'"
requestParameters := &graphusers.SettingsWindowsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphusers.SettingsWindowsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
windows, err := graphClient.Me().Settings().Windows().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsSettingCollectionResponse result = graphClient.me().settings().windows().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "settingType eq 'roaming'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let windows = await client.api('/me/settings/windows')
.version('beta')
.filter('settingType eq \'roaming\'')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Settings\Windows\WindowsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new WindowsRequestBuilderGetRequestConfiguration();
$queryParameters = WindowsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "settingType eq 'roaming'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->me()->settings()->windows()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Users
# A UPN can also be used as -UserId.
Get-MgBetaUserSettingWindows -UserId $userId -Filter "settingType eq 'roaming'"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.settings.windows.windows_request_builder import WindowsRequestBuilder
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 = WindowsRequestBuilder.WindowsRequestBuilderGetQueryParameters(
filter = "settingType eq 'roaming'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.me.settings.windows.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "default$windows.data.fileexplorerclassic.shellstatesettings",
"settingType": "roaming",
"payloadType": "windows.data.fileexplorerclassic.shellstatesettings",
"instances": [
{
"id": "0b3af867-49d1-4b94-041b-443ac419d417",
"payload": "VGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUh",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
},
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "default$windows.data.fileexplorerclassic.cabinetstatesettings",
"settingType": "roaming",
"payloadType": "windows.data.fileexplorerclassic.cabinetstatesettings",
"instances": [
{
"id": "5038fa1b-49d1-4b94-041b-443ac419d417",
"payload": "VGhpcyBpcyBhbm90aGVyIGp1c3QgYW4gZXhhbXBsZSE=",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
}
]
}
例 3: backup
settingType によるフィルターを使用した要求
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/me/settings/windows?$filter=settingType eq 'backup'
// 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.Me.Settings.Windows.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "settingType eq 'backup'";
});
mgc-beta users settings windows list --user-id {user-id} --filter "settingType eq 'backup'"
// 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"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
//other-imports
)
requestFilter := "settingType eq 'backup'"
requestParameters := &graphusers.SettingsWindowsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphusers.SettingsWindowsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
windows, err := graphClient.Me().Settings().Windows().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsSettingCollectionResponse result = graphClient.me().settings().windows().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "settingType eq 'backup'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let windows = await client.api('/me/settings/windows')
.version('beta')
.filter('settingType eq \'backup\'')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Settings\Windows\WindowsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new WindowsRequestBuilderGetRequestConfiguration();
$queryParameters = WindowsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "settingType eq 'backup'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->me()->settings()->windows()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Users
# A UPN can also be used as -UserId.
Get-MgBetaUserSettingWindows -UserId $userId -Filter "settingType eq 'backup'"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.settings.windows.windows_request_builder import WindowsRequestBuilder
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 = WindowsRequestBuilder.WindowsRequestBuilderGetQueryParameters(
filter = "settingType eq 'backup'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.me.settings.windows.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "{67585f9f-ee4b-4dd8-808e-d88375d66ef7}$windows.data.apps.devicemetadata",
"windowsDeviceId": "67585f9f-ee4b-4dd8-808e-d88375d66ef7",
"settingType": "backup",
"payloadType": "windows.data.apps.devicemetadata",
"instances": [
{
"id": "14b50191-10e5-4da5-9099-8c909b8458bd",
"payload": "VGhpcyBpcyBhbm90aGVyIGp1c3QgYW4gZXhhbXBsZSE=",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
},
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "{55f26da7-5824-4937-9028-9bba274f049f}$windows.data.apps.devicemetadata",
"windowsDeviceId": "55f26da7-5824-4937-9028-9bba274f049f",
"settingType": "backup",
"payloadType": "windows.data.apps.devicemetadata",
"instances": [
{
"id": "da2f0307-2a8d-4242-846f-56abd95f7213",
"payload": "VGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUh",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
}
]
}
例 4: フィルターによる要求 windowsDeviceId
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/me/settings/windows?$filter=windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'
// 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.Me.Settings.Windows.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'";
});
mgc-beta users settings windows list --user-id {user-id} --filter "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'"
// 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"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
//other-imports
)
requestFilter := "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'"
requestParameters := &graphusers.SettingsWindowsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphusers.SettingsWindowsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
windows, err := graphClient.Me().Settings().Windows().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsSettingCollectionResponse result = graphClient.me().settings().windows().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let windows = await client.api('/me/settings/windows')
.version('beta')
.filter('windowsDeviceId eq \'67585f9f-ee4b-4dd8-808e-d88375d66ef7\'')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Settings\Windows\WindowsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new WindowsRequestBuilderGetRequestConfiguration();
$queryParameters = WindowsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->me()->settings()->windows()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Users
# A UPN can also be used as -UserId.
Get-MgBetaUserSettingWindows -UserId $userId -Filter "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.settings.windows.windows_request_builder import WindowsRequestBuilder
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 = WindowsRequestBuilder.WindowsRequestBuilderGetQueryParameters(
filter = "windowsDeviceId eq '67585f9f-ee4b-4dd8-808e-d88375d66ef7'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.me.settings.windows.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.windowsSetting",
"id": "{67585f9f-ee4b-4dd8-808e-d88375d66ef7}$windows.data.apps.devicemetadata",
"windowsDeviceId": "67585f9f-ee4b-4dd8-808e-d88375d66ef7",
"settingType": "backup",
"payloadType": "windows.data.apps.devicemetadata",
"instances": [
{
"id": "14b50191-10e5-4da5-9099-8c909b8458bd",
"payload": "VGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUh",
"lastModifiedDateTime": "2024-10-31T23:30:41Z",
"createdDateTime": "2024-02-12T19:34:35.223Z",
"expirationDateTime": "2034-02-09T19:34:33.771Z"
}
]
}
]
}