// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new GroupLifecyclePolicy
{
GroupLifetimeInDays = 100,
ManagedGroupTypes = "Selected",
AlternateNotificationEmails = "admin@contoso.com",
};
var result = await graphClient.GroupLifecyclePolicies.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc group-lifecycle-policies create --body '{\
"groupLifetimeInDays": 100,\
"managedGroupTypes": "Selected",\
"alternateNotificationEmails": "admin@contoso.com"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GroupLifecyclePolicy();
$requestBody->setGroupLifetimeInDays(100);
$requestBody->setManagedGroupTypes('Selected');
$requestBody->setAlternateNotificationEmails('admin@contoso.com');
$result = $graphServiceClient->groupLifecyclePolicies()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = GroupLifecyclePolicy(
group_lifetime_in_days = 100,
managed_group_types = "Selected",
alternate_notification_emails = "admin@contoso.com",
)
result = await graph_client.group_lifecycle_policies.post(body = request_body)