// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Admin.Windows.Updates.Deployments.Item.Audience.MicrosoftGraphWindowsUpdatesUpdateAudienceById;
var requestBody = new UpdateAudienceByIdPostRequestBody
{
MemberEntityType = "String",
AddMembers = new List<string>
{
"String",
},
RemoveMembers = new List<string>
{
"String",
},
AddExclusions = new List<string>
{
"String",
},
RemoveExclusions = new List<string>
{
"String",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Admin.Windows.Updates.Deployments["{deployment-id}"].Audience.MicrosoftGraphWindowsUpdatesUpdateAudienceById.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.admin.windows.updates.deployments.item.audience.microsoftgraphwindowsupdatesupdateaudiencebyid.UpdateAudienceByIdPostRequestBody updateAudienceByIdPostRequestBody = new com.microsoft.graph.beta.admin.windows.updates.deployments.item.audience.microsoftgraphwindowsupdatesupdateaudiencebyid.UpdateAudienceByIdPostRequestBody();
updateAudienceByIdPostRequestBody.setMemberEntityType("String");
LinkedList<String> addMembers = new LinkedList<String>();
addMembers.add("String");
updateAudienceByIdPostRequestBody.setAddMembers(addMembers);
LinkedList<String> removeMembers = new LinkedList<String>();
removeMembers.add("String");
updateAudienceByIdPostRequestBody.setRemoveMembers(removeMembers);
LinkedList<String> addExclusions = new LinkedList<String>();
addExclusions.add("String");
updateAudienceByIdPostRequestBody.setAddExclusions(addExclusions);
LinkedList<String> removeExclusions = new LinkedList<String>();
removeExclusions.add("String");
updateAudienceByIdPostRequestBody.setRemoveExclusions(removeExclusions);
graphClient.admin().windows().updates().deployments().byDeploymentId("{deployment-id}").audience().microsoftGraphWindowsUpdatesUpdateAudienceById().post(updateAudienceByIdPostRequestBody);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.windows.updates.deployments.item.audience.microsoft_graph_windows_updates_update_audience_by_id.update_audience_by_id_post_request_body import UpdateAudienceByIdPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UpdateAudienceByIdPostRequestBody(
member_entity_type = "String",
add_members = [
"String",
],
remove_members = [
"String",
],
add_exclusions = [
"String",
],
remove_exclusions = [
"String",
],
)
await graph_client.admin.windows.updates.deployments.by_deployment_id('deployment-id').audience.microsoft_graph_windows_updates_update_audience_by_id.post(request_body)