設定をリストする
[アーティクル]
05/05/2022
2 人の共同作成者
この記事の内容
名前空間: microsoft.graph
テナント レベルまたはグループ固有のグループ設定オブジェクトの一覧を取得します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
テナント全体の設定を一覧表示する
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
Directory.Read.All、Directory.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
Directory.Read.All、Directory.ReadWrite.All
グループ固有の設定を一覧表示する
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
Group.Read.All、Group.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
Group.Read.All、Group.ReadWrite.All
HTTP 要求
テナント全体の設定を一覧表示します。
GET /groupSettings
グループ固有の設定を一覧表示する
GET /groups/{groupId}/settings
オプションのクエリ パラメーター
このメソッドは、応答を $selectカスタマイズするのに役立つ OData クエリ パラメーター をサポートします。
名前
説明
Authorization
ベアラー {token}。必須。
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと応答本文内の groupSetting オブジェクトのコレクションを返します。
例
例: テナント レベルのグループ設定を取得する
要求
GET https://graph.microsoft.com/v1.0/groupSettings
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.Groups["{group-id}"].Settings["{groupSetting-id}"]
.Request()
.GetAsync();
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var groupSetting = await graphClient.Groups["{group-id}"].Settings["{groupSetting-id}"]
.Request()
.GetAsync();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe')
.get();
const options = {
authProvider,
};
const client = Client.init(options);
let groupSetting = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe')
.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:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings/a06fa228-3042-4662-bd09-33e298da1afe"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings("a06fa228-3042-4662-bd09-33e298da1afe")
.buildRequest()
.get();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSetting groupSetting = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings("a06fa228-3042-4662-bd09-33e298da1afe")
.buildRequest()
.get();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupsById(&groupId).SettingsById(&groupSettingId).Get()
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
groupSettingId := "groupSetting-id"
result, err := graphClient.GroupsById(&groupId).SettingsById(&groupSettingId).Get()
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings",
"value": [
{
"id": "f0b2d6f5-097d-4177-91af-a24e530b53cc",
"displayName": "Group.Unified",
"templateId": "62375ab9-6b52-47ed-826b-58e47e0e304b",
"values": [
{
"name": "EnableMIPLabels",
"value": "true"
},
{
"name": "CustomBlockedWordsList",
"value": ""
},
{
"name": "EnableMSStandardBlockedWords",
"value": "true"
},
{
"name": "ClassificationDescriptions",
"value": ""
},
{
"name": "DefaultClassification",
"value": ""
},
{
"name": "PrefixSuffixNamingRequirement",
"value": "[Contoso-][GroupName]"
},
{
"name": "AllowGuestsToBeGroupOwner",
"value": "false"
},
{
"name": "AllowGuestsToAccessGroups",
"value": "true"
},
{
"name": "GuestUsageGuidelinesUrl",
"value": "https://privacy.contoso.com/privacystatement"
},
{
"name": "GroupCreationAllowedGroupId",
"value": ""
},
{
"name": "AllowToAddGuests",
"value": "true"
},
{
"name": "UsageGuidelinesUrl",
"value": ""
},
{
"name": "ClassificationList",
"value": ""
},
{
"name": "EnableGroupCreation",
"value": "true"
}
]
}
]
}
例 2: 特定のグループのグループ設定を取得する
要求
GET https://graph.microsoft.com/v1.0/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var settings = await graphClient.Groups["{group-id}"].Settings
.Request()
.GetAsync();
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var settings = await graphClient.Groups["{group-id}"].Settings
.Request()
.GetAsync();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
let settings = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings')
.get();
const options = {
authProvider,
};
const client = Client.init(options);
let settings = await client.api('/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings')
.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:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphGroupSetting *groupSetting = [[MSGraphGroupSetting alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSettingCollectionPage settings = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings()
.buildRequest()
.get();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
GroupSettingCollectionPage settings = graphClient.groups("05aa6a98-956a-45c0-b13b-88076a23f2cd").settings()
.buildRequest()
.get();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
result, err := graphClient.GroupsById(&groupId).Settings().Get()
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
result, err := graphClient.GroupsById(&groupId).Settings().Get()
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings",
"value": [
{
"id": "a06fa228-3042-4662-bd09-33e298da1afe",
"displayName": "Group.Unified.Guest",
"templateId": "08d542b9-071f-4e16-94b0-74abb372e3d9",
"values": [
{
"name": "AllowToAddGuests",
"value": "false"
}
]
}
]
}