PATCH https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}
Content-type: application/json
Content-length: 1963
{
"@odata.type": "#microsoft.graph.windowsUpdateForBusinessConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"deliveryOptimizationMode": "httpOnly",
"prereleaseFeatures": "settingsOnly",
"automaticUpdateMode": "notifyDownload",
"microsoftUpdateServiceAllowed": true,
"driversExcluded": true,
"installationSchedule": {
"@odata.type": "microsoft.graph.windowsUpdateScheduledInstall",
"scheduledInstallDay": "everyday",
"scheduledInstallTime": "11:59:31.3170000"
},
"qualityUpdatesDeferralPeriodInDays": 2,
"featureUpdatesDeferralPeriodInDays": 2,
"qualityUpdatesPaused": true,
"featureUpdatesPaused": true,
"qualityUpdatesPauseExpiryDateTime": "2017-01-01T00:00:22.9594683-08:00",
"featureUpdatesPauseExpiryDateTime": "2016-12-31T23:58:08.068669-08:00",
"businessReadyUpdatesOnly": "all",
"skipChecksBeforeRestart": true,
"updateWeeks": "firstWeek",
"qualityUpdatesPauseStartDate": "2016-12-31",
"featureUpdatesPauseStartDate": "2016-12-31",
"featureUpdatesRollbackWindowInDays": 2,
"qualityUpdatesWillBeRolledBack": true,
"featureUpdatesWillBeRolledBack": true,
"qualityUpdatesRollbackStartDateTime": "2016-12-31T23:57:01.05526-08:00",
"featureUpdatesRollbackStartDateTime": "2017-01-01T00:03:21.6080517-08:00",
"engagedRestartDeadlineInDays": 12,
"engagedRestartSnoozeScheduleInDays": 2,
"engagedRestartTransitionScheduleInDays": 6,
"deadlineForFeatureUpdatesInDays": 15,
"deadlineForQualityUpdatesInDays": 15,
"deadlineGracePeriodInDays": 9,
"postponeRebootUntilAfterDeadline": true,
"autoRestartNotificationDismissal": "automatic",
"scheduleRestartWarningInHours": 13,
"scheduleImminentRestartWarningInMinutes": 7,
"userPauseAccess": "enabled",
"userWindowsUpdateScanAccess": "enabled",
"updateNotificationLevel": "defaultNotifications",
"allowWindows11Upgrade": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new WindowsUpdateForBusinessConfiguration
{
OdataType = "#microsoft.graph.windowsUpdateForBusinessConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
DeliveryOptimizationMode = WindowsDeliveryOptimizationMode.HttpOnly,
PrereleaseFeatures = PrereleaseFeatures.SettingsOnly,
AutomaticUpdateMode = AutomaticUpdateMode.NotifyDownload,
MicrosoftUpdateServiceAllowed = true,
DriversExcluded = true,
InstallationSchedule = new WindowsUpdateScheduledInstall
{
OdataType = "microsoft.graph.windowsUpdateScheduledInstall",
ScheduledInstallDay = WeeklySchedule.Everyday,
ScheduledInstallTime = new Time(DateTime.Parse("11:59:31.3170000")),
},
QualityUpdatesDeferralPeriodInDays = 2,
FeatureUpdatesDeferralPeriodInDays = 2,
QualityUpdatesPaused = true,
FeatureUpdatesPaused = true,
QualityUpdatesPauseExpiryDateTime = DateTimeOffset.Parse("2017-01-01T00:00:22.9594683-08:00"),
FeatureUpdatesPauseExpiryDateTime = DateTimeOffset.Parse("2016-12-31T23:58:08.068669-08:00"),
BusinessReadyUpdatesOnly = WindowsUpdateType.All,
SkipChecksBeforeRestart = true,
UpdateWeeks = WindowsUpdateForBusinessUpdateWeeks.FirstWeek,
QualityUpdatesPauseStartDate = new Date(DateTime.Parse("2016-12-31")),
FeatureUpdatesPauseStartDate = new Date(DateTime.Parse("2016-12-31")),
FeatureUpdatesRollbackWindowInDays = 2,
QualityUpdatesWillBeRolledBack = true,
FeatureUpdatesWillBeRolledBack = true,
QualityUpdatesRollbackStartDateTime = DateTimeOffset.Parse("2016-12-31T23:57:01.05526-08:00"),
FeatureUpdatesRollbackStartDateTime = DateTimeOffset.Parse("2017-01-01T00:03:21.6080517-08:00"),
EngagedRestartDeadlineInDays = 12,
EngagedRestartSnoozeScheduleInDays = 2,
EngagedRestartTransitionScheduleInDays = 6,
DeadlineForFeatureUpdatesInDays = 15,
DeadlineForQualityUpdatesInDays = 15,
DeadlineGracePeriodInDays = 9,
PostponeRebootUntilAfterDeadline = true,
AutoRestartNotificationDismissal = AutoRestartNotificationDismissalMethod.Automatic,
ScheduleRestartWarningInHours = 13,
ScheduleImminentRestartWarningInMinutes = 7,
UserPauseAccess = Enablement.Enabled,
UserWindowsUpdateScanAccess = Enablement.Enabled,
UpdateNotificationLevel = WindowsUpdateNotificationDisplayOption.DefaultNotifications,
AllowWindows11Upgrade = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceConfigurations["{deviceConfiguration-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc device-management device-configurations patch --device-configuration-id {deviceConfiguration-id} --body '{\
"@odata.type": "#microsoft.graph.windowsUpdateForBusinessConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"deliveryOptimizationMode": "httpOnly",\
"prereleaseFeatures": "settingsOnly",\
"automaticUpdateMode": "notifyDownload",\
"microsoftUpdateServiceAllowed": true,\
"driversExcluded": true,\
"installationSchedule": {\
"@odata.type": "microsoft.graph.windowsUpdateScheduledInstall",\
"scheduledInstallDay": "everyday",\
"scheduledInstallTime": "11:59:31.3170000"\
},\
"qualityUpdatesDeferralPeriodInDays": 2,\
"featureUpdatesDeferralPeriodInDays": 2,\
"qualityUpdatesPaused": true,\
"featureUpdatesPaused": true,\
"qualityUpdatesPauseExpiryDateTime": "2017-01-01T00:00:22.9594683-08:00",\
"featureUpdatesPauseExpiryDateTime": "2016-12-31T23:58:08.068669-08:00",\
"businessReadyUpdatesOnly": "all",\
"skipChecksBeforeRestart": true,\
"updateWeeks": "firstWeek",\
"qualityUpdatesPauseStartDate": "2016-12-31",\
"featureUpdatesPauseStartDate": "2016-12-31",\
"featureUpdatesRollbackWindowInDays": 2,\
"qualityUpdatesWillBeRolledBack": true,\
"featureUpdatesWillBeRolledBack": true,\
"qualityUpdatesRollbackStartDateTime": "2016-12-31T23:57:01.05526-08:00",\
"featureUpdatesRollbackStartDateTime": "2017-01-01T00:03:21.6080517-08:00",\
"engagedRestartDeadlineInDays": 12,\
"engagedRestartSnoozeScheduleInDays": 2,\
"engagedRestartTransitionScheduleInDays": 6,\
"deadlineForFeatureUpdatesInDays": 15,\
"deadlineForQualityUpdatesInDays": 15,\
"deadlineGracePeriodInDays": 9,\
"postponeRebootUntilAfterDeadline": true,\
"autoRestartNotificationDismissal": "automatic",\
"scheduleRestartWarningInHours": 13,\
"scheduleImminentRestartWarningInMinutes": 7,\
"userPauseAccess": "enabled",\
"userWindowsUpdateScanAccess": "enabled",\
"updateNotificationLevel": "defaultNotifications",\
"allowWindows11Upgrade": true\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewDeviceConfiguration()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := int32(7)
requestBody.SetVersion(&version)
deliveryOptimizationMode := graphmodels.HTTPONLY_WINDOWSDELIVERYOPTIMIZATIONMODE
requestBody.SetDeliveryOptimizationMode(&deliveryOptimizationMode)
prereleaseFeatures := graphmodels.SETTINGSONLY_PRERELEASEFEATURES
requestBody.SetPrereleaseFeatures(&prereleaseFeatures)
automaticUpdateMode := graphmodels.NOTIFYDOWNLOAD_AUTOMATICUPDATEMODE
requestBody.SetAutomaticUpdateMode(&automaticUpdateMode)
microsoftUpdateServiceAllowed := true
requestBody.SetMicrosoftUpdateServiceAllowed(µsoftUpdateServiceAllowed)
driversExcluded := true
requestBody.SetDriversExcluded(&driversExcluded)
installationSchedule := graphmodels.NewWindowsUpdateScheduledInstall()
scheduledInstallDay := graphmodels.EVERYDAY_WEEKLYSCHEDULE
installationSchedule.SetScheduledInstallDay(&scheduledInstallDay)
scheduledInstallTime := 11:59:31.3170000
installationSchedule.SetScheduledInstallTime(&scheduledInstallTime)
requestBody.SetInstallationSchedule(installationSchedule)
qualityUpdatesDeferralPeriodInDays := int32(2)
requestBody.SetQualityUpdatesDeferralPeriodInDays(&qualityUpdatesDeferralPeriodInDays)
featureUpdatesDeferralPeriodInDays := int32(2)
requestBody.SetFeatureUpdatesDeferralPeriodInDays(&featureUpdatesDeferralPeriodInDays)
qualityUpdatesPaused := true
requestBody.SetQualityUpdatesPaused(&qualityUpdatesPaused)
featureUpdatesPaused := true
requestBody.SetFeatureUpdatesPaused(&featureUpdatesPaused)
qualityUpdatesPauseExpiryDateTime , err := time.Parse(time.RFC3339, "2017-01-01T00:00:22.9594683-08:00")
requestBody.SetQualityUpdatesPauseExpiryDateTime(&qualityUpdatesPauseExpiryDateTime)
featureUpdatesPauseExpiryDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:58:08.068669-08:00")
requestBody.SetFeatureUpdatesPauseExpiryDateTime(&featureUpdatesPauseExpiryDateTime)
businessReadyUpdatesOnly := graphmodels.ALL_WINDOWSUPDATETYPE
requestBody.SetBusinessReadyUpdatesOnly(&businessReadyUpdatesOnly)
skipChecksBeforeRestart := true
requestBody.SetSkipChecksBeforeRestart(&skipChecksBeforeRestart)
updateWeeks := graphmodels.FIRSTWEEK_WINDOWSUPDATEFORBUSINESSUPDATEWEEKS
requestBody.SetUpdateWeeks(&updateWeeks)
qualityUpdatesPauseStartDate := 2016-12-31
requestBody.SetQualityUpdatesPauseStartDate(&qualityUpdatesPauseStartDate)
featureUpdatesPauseStartDate := 2016-12-31
requestBody.SetFeatureUpdatesPauseStartDate(&featureUpdatesPauseStartDate)
featureUpdatesRollbackWindowInDays := int32(2)
requestBody.SetFeatureUpdatesRollbackWindowInDays(&featureUpdatesRollbackWindowInDays)
qualityUpdatesWillBeRolledBack := true
requestBody.SetQualityUpdatesWillBeRolledBack(&qualityUpdatesWillBeRolledBack)
featureUpdatesWillBeRolledBack := true
requestBody.SetFeatureUpdatesWillBeRolledBack(&featureUpdatesWillBeRolledBack)
qualityUpdatesRollbackStartDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:01.05526-08:00")
requestBody.SetQualityUpdatesRollbackStartDateTime(&qualityUpdatesRollbackStartDateTime)
featureUpdatesRollbackStartDateTime , err := time.Parse(time.RFC3339, "2017-01-01T00:03:21.6080517-08:00")
requestBody.SetFeatureUpdatesRollbackStartDateTime(&featureUpdatesRollbackStartDateTime)
engagedRestartDeadlineInDays := int32(12)
requestBody.SetEngagedRestartDeadlineInDays(&engagedRestartDeadlineInDays)
engagedRestartSnoozeScheduleInDays := int32(2)
requestBody.SetEngagedRestartSnoozeScheduleInDays(&engagedRestartSnoozeScheduleInDays)
engagedRestartTransitionScheduleInDays := int32(6)
requestBody.SetEngagedRestartTransitionScheduleInDays(&engagedRestartTransitionScheduleInDays)
deadlineForFeatureUpdatesInDays := int32(15)
requestBody.SetDeadlineForFeatureUpdatesInDays(&deadlineForFeatureUpdatesInDays)
deadlineForQualityUpdatesInDays := int32(15)
requestBody.SetDeadlineForQualityUpdatesInDays(&deadlineForQualityUpdatesInDays)
deadlineGracePeriodInDays := int32(9)
requestBody.SetDeadlineGracePeriodInDays(&deadlineGracePeriodInDays)
postponeRebootUntilAfterDeadline := true
requestBody.SetPostponeRebootUntilAfterDeadline(&postponeRebootUntilAfterDeadline)
autoRestartNotificationDismissal := graphmodels.AUTOMATIC_AUTORESTARTNOTIFICATIONDISMISSALMETHOD
requestBody.SetAutoRestartNotificationDismissal(&autoRestartNotificationDismissal)
scheduleRestartWarningInHours := int32(13)
requestBody.SetScheduleRestartWarningInHours(&scheduleRestartWarningInHours)
scheduleImminentRestartWarningInMinutes := int32(7)
requestBody.SetScheduleImminentRestartWarningInMinutes(&scheduleImminentRestartWarningInMinutes)
userPauseAccess := graphmodels.ENABLED_ENABLEMENT
requestBody.SetUserPauseAccess(&userPauseAccess)
userWindowsUpdateScanAccess := graphmodels.ENABLED_ENABLEMENT
requestBody.SetUserWindowsUpdateScanAccess(&userWindowsUpdateScanAccess)
updateNotificationLevel := graphmodels.DEFAULTNOTIFICATIONS_WINDOWSUPDATENOTIFICATIONDISPLAYOPTION
requestBody.SetUpdateNotificationLevel(&updateNotificationLevel)
allowWindows11Upgrade := true
requestBody.SetAllowWindows11Upgrade(&allowWindows11Upgrade)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
deviceConfigurations, err := graphClient.DeviceManagement().DeviceConfigurations().ByDeviceConfigurationId("deviceConfiguration-id").Patch(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsUpdateForBusinessConfiguration deviceConfiguration = new WindowsUpdateForBusinessConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.windowsUpdateForBusinessConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setDeliveryOptimizationMode(WindowsDeliveryOptimizationMode.HttpOnly);
deviceConfiguration.setPrereleaseFeatures(PrereleaseFeatures.SettingsOnly);
deviceConfiguration.setAutomaticUpdateMode(AutomaticUpdateMode.NotifyDownload);
deviceConfiguration.setMicrosoftUpdateServiceAllowed(true);
deviceConfiguration.setDriversExcluded(true);
WindowsUpdateScheduledInstall installationSchedule = new WindowsUpdateScheduledInstall();
installationSchedule.setOdataType("microsoft.graph.windowsUpdateScheduledInstall");
installationSchedule.setScheduledInstallDay(WeeklySchedule.Everyday);
LocalTime scheduledInstallTime = LocalTime.parse("11:59:31.3170000");
installationSchedule.setScheduledInstallTime(scheduledInstallTime);
deviceConfiguration.setInstallationSchedule(installationSchedule);
deviceConfiguration.setQualityUpdatesDeferralPeriodInDays(2);
deviceConfiguration.setFeatureUpdatesDeferralPeriodInDays(2);
deviceConfiguration.setQualityUpdatesPaused(true);
deviceConfiguration.setFeatureUpdatesPaused(true);
OffsetDateTime qualityUpdatesPauseExpiryDateTime = OffsetDateTime.parse("2017-01-01T00:00:22.9594683-08:00");
deviceConfiguration.setQualityUpdatesPauseExpiryDateTime(qualityUpdatesPauseExpiryDateTime);
OffsetDateTime featureUpdatesPauseExpiryDateTime = OffsetDateTime.parse("2016-12-31T23:58:08.068669-08:00");
deviceConfiguration.setFeatureUpdatesPauseExpiryDateTime(featureUpdatesPauseExpiryDateTime);
deviceConfiguration.setBusinessReadyUpdatesOnly(WindowsUpdateType.All);
deviceConfiguration.setSkipChecksBeforeRestart(true);
deviceConfiguration.setUpdateWeeks(EnumSet.of(WindowsUpdateForBusinessUpdateWeeks.FirstWeek));
LocalDate qualityUpdatesPauseStartDate = LocalDate.parse("2016-12-31");
deviceConfiguration.setQualityUpdatesPauseStartDate(qualityUpdatesPauseStartDate);
LocalDate featureUpdatesPauseStartDate = LocalDate.parse("2016-12-31");
deviceConfiguration.setFeatureUpdatesPauseStartDate(featureUpdatesPauseStartDate);
deviceConfiguration.setFeatureUpdatesRollbackWindowInDays(2);
deviceConfiguration.setQualityUpdatesWillBeRolledBack(true);
deviceConfiguration.setFeatureUpdatesWillBeRolledBack(true);
OffsetDateTime qualityUpdatesRollbackStartDateTime = OffsetDateTime.parse("2016-12-31T23:57:01.05526-08:00");
deviceConfiguration.setQualityUpdatesRollbackStartDateTime(qualityUpdatesRollbackStartDateTime);
OffsetDateTime featureUpdatesRollbackStartDateTime = OffsetDateTime.parse("2017-01-01T00:03:21.6080517-08:00");
deviceConfiguration.setFeatureUpdatesRollbackStartDateTime(featureUpdatesRollbackStartDateTime);
deviceConfiguration.setEngagedRestartDeadlineInDays(12);
deviceConfiguration.setEngagedRestartSnoozeScheduleInDays(2);
deviceConfiguration.setEngagedRestartTransitionScheduleInDays(6);
deviceConfiguration.setDeadlineForFeatureUpdatesInDays(15);
deviceConfiguration.setDeadlineForQualityUpdatesInDays(15);
deviceConfiguration.setDeadlineGracePeriodInDays(9);
deviceConfiguration.setPostponeRebootUntilAfterDeadline(true);
deviceConfiguration.setAutoRestartNotificationDismissal(AutoRestartNotificationDismissalMethod.Automatic);
deviceConfiguration.setScheduleRestartWarningInHours(13);
deviceConfiguration.setScheduleImminentRestartWarningInMinutes(7);
deviceConfiguration.setUserPauseAccess(Enablement.Enabled);
deviceConfiguration.setUserWindowsUpdateScanAccess(Enablement.Enabled);
deviceConfiguration.setUpdateNotificationLevel(WindowsUpdateNotificationDisplayOption.DefaultNotifications);
deviceConfiguration.setAllowWindows11Upgrade(true);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().byDeviceConfigurationId("{deviceConfiguration-id}").patch(deviceConfiguration);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const deviceConfiguration = {
'@odata.type': '#microsoft.graph.windowsUpdateForBusinessConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
deliveryOptimizationMode: 'httpOnly',
prereleaseFeatures: 'settingsOnly',
automaticUpdateMode: 'notifyDownload',
microsoftUpdateServiceAllowed: true,
driversExcluded: true,
installationSchedule: {
'@odata.type': 'microsoft.graph.windowsUpdateScheduledInstall',
scheduledInstallDay: 'everyday',
scheduledInstallTime: '11:59:31.3170000'
},
qualityUpdatesDeferralPeriodInDays: 2,
featureUpdatesDeferralPeriodInDays: 2,
qualityUpdatesPaused: true,
featureUpdatesPaused: true,
qualityUpdatesPauseExpiryDateTime: '2017-01-01T00:00:22.9594683-08:00',
featureUpdatesPauseExpiryDateTime: '2016-12-31T23:58:08.068669-08:00',
businessReadyUpdatesOnly: 'all',
skipChecksBeforeRestart: true,
updateWeeks: 'firstWeek',
qualityUpdatesPauseStartDate: '2016-12-31',
featureUpdatesPauseStartDate: '2016-12-31',
featureUpdatesRollbackWindowInDays: 2,
qualityUpdatesWillBeRolledBack: true,
featureUpdatesWillBeRolledBack: true,
qualityUpdatesRollbackStartDateTime: '2016-12-31T23:57:01.05526-08:00',
featureUpdatesRollbackStartDateTime: '2017-01-01T00:03:21.6080517-08:00',
engagedRestartDeadlineInDays: 12,
engagedRestartSnoozeScheduleInDays: 2,
engagedRestartTransitionScheduleInDays: 6,
deadlineForFeatureUpdatesInDays: 15,
deadlineForQualityUpdatesInDays: 15,
deadlineGracePeriodInDays: 9,
postponeRebootUntilAfterDeadline: true,
autoRestartNotificationDismissal: 'automatic',
scheduleRestartWarningInHours: 13,
scheduleImminentRestartWarningInMinutes: 7,
userPauseAccess: 'enabled',
userWindowsUpdateScanAccess: 'enabled',
updateNotificationLevel: 'defaultNotifications',
allowWindows11Upgrade: true
};
await client.api('/deviceManagement/deviceConfigurations/{deviceConfigurationId}')
.update(deviceConfiguration);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\WindowsUpdateForBusinessConfiguration;
use Microsoft\Graph\Generated\Models\WindowsDeliveryOptimizationMode;
use Microsoft\Graph\Generated\Models\PrereleaseFeatures;
use Microsoft\Graph\Generated\Models\AutomaticUpdateMode;
use Microsoft\Graph\Generated\Models\WindowsUpdateScheduledInstall;
use Microsoft\Graph\Generated\Models\WeeklySchedule;
use Microsoft\Kiota\Abstractions\Types\Time;
use Microsoft\Graph\Generated\Models\WindowsUpdateType;
use Microsoft\Graph\Generated\Models\WindowsUpdateForBusinessUpdateWeeks;
use Microsoft\Kiota\Abstractions\Types\Date;
use Microsoft\Graph\Generated\Models\AutoRestartNotificationDismissalMethod;
use Microsoft\Graph\Generated\Models\Enablement;
use Microsoft\Graph\Generated\Models\WindowsUpdateNotificationDisplayOption;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WindowsUpdateForBusinessConfiguration();
$requestBody->setOdataType('#microsoft.graph.windowsUpdateForBusinessConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setDeliveryOptimizationMode(new WindowsDeliveryOptimizationMode('httpOnly'));
$requestBody->setPrereleaseFeatures(new PrereleaseFeatures('settingsOnly'));
$requestBody->setAutomaticUpdateMode(new AutomaticUpdateMode('notifyDownload'));
$requestBody->setMicrosoftUpdateServiceAllowed(true);
$requestBody->setDriversExcluded(true);
$installationSchedule = new WindowsUpdateScheduledInstall();
$installationSchedule->setOdataType('microsoft.graph.windowsUpdateScheduledInstall');
$installationSchedule->setScheduledInstallDay(new WeeklySchedule('everyday'));
$installationSchedule->setScheduledInstallTime(new Time('11:59:31.3170000'));
$requestBody->setInstallationSchedule($installationSchedule);
$requestBody->setQualityUpdatesDeferralPeriodInDays(2);
$requestBody->setFeatureUpdatesDeferralPeriodInDays(2);
$requestBody->setQualityUpdatesPaused(true);
$requestBody->setFeatureUpdatesPaused(true);
$requestBody->setQualityUpdatesPauseExpiryDateTime(new \DateTime('2017-01-01T00:00:22.9594683-08:00'));
$requestBody->setFeatureUpdatesPauseExpiryDateTime(new \DateTime('2016-12-31T23:58:08.068669-08:00'));
$requestBody->setBusinessReadyUpdatesOnly(new WindowsUpdateType('all'));
$requestBody->setSkipChecksBeforeRestart(true);
$requestBody->setUpdateWeeks(new WindowsUpdateForBusinessUpdateWeeks('firstWeek'));
$requestBody->setQualityUpdatesPauseStartDate(new Date('2016-12-31'));
$requestBody->setFeatureUpdatesPauseStartDate(new Date('2016-12-31'));
$requestBody->setFeatureUpdatesRollbackWindowInDays(2);
$requestBody->setQualityUpdatesWillBeRolledBack(true);
$requestBody->setFeatureUpdatesWillBeRolledBack(true);
$requestBody->setQualityUpdatesRollbackStartDateTime(new \DateTime('2016-12-31T23:57:01.05526-08:00'));
$requestBody->setFeatureUpdatesRollbackStartDateTime(new \DateTime('2017-01-01T00:03:21.6080517-08:00'));
$requestBody->setEngagedRestartDeadlineInDays(12);
$requestBody->setEngagedRestartSnoozeScheduleInDays(2);
$requestBody->setEngagedRestartTransitionScheduleInDays(6);
$requestBody->setDeadlineForFeatureUpdatesInDays(15);
$requestBody->setDeadlineForQualityUpdatesInDays(15);
$requestBody->setDeadlineGracePeriodInDays(9);
$requestBody->setPostponeRebootUntilAfterDeadline(true);
$requestBody->setAutoRestartNotificationDismissal(new AutoRestartNotificationDismissalMethod('automatic'));
$requestBody->setScheduleRestartWarningInHours(13);
$requestBody->setScheduleImminentRestartWarningInMinutes(7);
$requestBody->setUserPauseAccess(new Enablement('enabled'));
$requestBody->setUserWindowsUpdateScanAccess(new Enablement('enabled'));
$requestBody->setUpdateNotificationLevel(new WindowsUpdateNotificationDisplayOption('defaultNotifications'));
$requestBody->setAllowWindows11Upgrade(true);
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->byDeviceConfigurationId('deviceConfiguration-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.windowsUpdateForBusinessConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
deliveryOptimizationMode = "httpOnly"
prereleaseFeatures = "settingsOnly"
automaticUpdateMode = "notifyDownload"
microsoftUpdateServiceAllowed = $true
driversExcluded = $true
installationSchedule = @{
"@odata.type" = "microsoft.graph.windowsUpdateScheduledInstall"
scheduledInstallDay = "everyday"
scheduledInstallTime = "11:59:31.3170000"
}
qualityUpdatesDeferralPeriodInDays =
featureUpdatesDeferralPeriodInDays =
qualityUpdatesPaused = $true
featureUpdatesPaused = $true
qualityUpdatesPauseExpiryDateTime = "2017-01-01T00:00:22.9594683-08:00"
featureUpdatesPauseExpiryDateTime = "2016-12-31T23:58:08.068669-08:00"
businessReadyUpdatesOnly = "all"
skipChecksBeforeRestart = $true
updateWeeks = "firstWeek"
qualityUpdatesPauseStartDate = "2016-12-31"
featureUpdatesPauseStartDate = "2016-12-31"
featureUpdatesRollbackWindowInDays =
qualityUpdatesWillBeRolledBack = $true
featureUpdatesWillBeRolledBack = $true
qualityUpdatesRollbackStartDateTime = "2016-12-31T23:57:01.05526-08:00"
featureUpdatesRollbackStartDateTime = "2017-01-01T00:03:21.6080517-08:00"
engagedRestartDeadlineInDays =
engagedRestartSnoozeScheduleInDays =
engagedRestartTransitionScheduleInDays =
deadlineForFeatureUpdatesInDays =
deadlineForQualityUpdatesInDays =
deadlineGracePeriodInDays =
postponeRebootUntilAfterDeadline = $true
autoRestartNotificationDismissal = "automatic"
scheduleRestartWarningInHours =
scheduleImminentRestartWarningInMinutes =
userPauseAccess = "enabled"
userWindowsUpdateScanAccess = "enabled"
updateNotificationLevel = "defaultNotifications"
allowWindows11Upgrade = $true
}
Update-MgDeviceManagementDeviceConfiguration -DeviceConfigurationId $deviceConfigurationId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.windows_update_for_business_configuration import WindowsUpdateForBusinessConfiguration
from msgraph.generated.models.windows_delivery_optimization_mode import WindowsDeliveryOptimizationMode
from msgraph.generated.models.prerelease_features import PrereleaseFeatures
from msgraph.generated.models.automatic_update_mode import AutomaticUpdateMode
from msgraph.generated.models.windows_update_scheduled_install import WindowsUpdateScheduledInstall
from msgraph.generated.models.weekly_schedule import WeeklySchedule
from msgraph.generated.models.windows_update_type import WindowsUpdateType
from msgraph.generated.models.windows_update_for_business_update_weeks import WindowsUpdateForBusinessUpdateWeeks
from msgraph.generated.models.auto_restart_notification_dismissal_method import AutoRestartNotificationDismissalMethod
from msgraph.generated.models.enablement import Enablement
from msgraph.generated.models.windows_update_notification_display_option import WindowsUpdateNotificationDisplayOption
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = WindowsUpdateForBusinessConfiguration(
odata_type = "#microsoft.graph.windowsUpdateForBusinessConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
delivery_optimization_mode = WindowsDeliveryOptimizationMode.HttpOnly,
prerelease_features = PrereleaseFeatures.SettingsOnly,
automatic_update_mode = AutomaticUpdateMode.NotifyDownload,
microsoft_update_service_allowed = True,
drivers_excluded = True,
installation_schedule = WindowsUpdateScheduledInstall(
odata_type = "microsoft.graph.windowsUpdateScheduledInstall",
scheduled_install_day = WeeklySchedule.Everyday,
scheduled_install_time = "11:59:31.3170000",
),
quality_updates_deferral_period_in_days = 2,
feature_updates_deferral_period_in_days = 2,
quality_updates_paused = True,
feature_updates_paused = True,
quality_updates_pause_expiry_date_time = "2017-01-01T00:00:22.9594683-08:00",
feature_updates_pause_expiry_date_time = "2016-12-31T23:58:08.068669-08:00",
business_ready_updates_only = WindowsUpdateType.All,
skip_checks_before_restart = True,
update_weeks = WindowsUpdateForBusinessUpdateWeeks.FirstWeek,
quality_updates_pause_start_date = "2016-12-31",
feature_updates_pause_start_date = "2016-12-31",
feature_updates_rollback_window_in_days = 2,
quality_updates_will_be_rolled_back = True,
feature_updates_will_be_rolled_back = True,
quality_updates_rollback_start_date_time = "2016-12-31T23:57:01.05526-08:00",
feature_updates_rollback_start_date_time = "2017-01-01T00:03:21.6080517-08:00",
engaged_restart_deadline_in_days = 12,
engaged_restart_snooze_schedule_in_days = 2,
engaged_restart_transition_schedule_in_days = 6,
deadline_for_feature_updates_in_days = 15,
deadline_for_quality_updates_in_days = 15,
deadline_grace_period_in_days = 9,
postpone_reboot_until_after_deadline = True,
auto_restart_notification_dismissal = AutoRestartNotificationDismissalMethod.Automatic,
schedule_restart_warning_in_hours = 13,
schedule_imminent_restart_warning_in_minutes = 7,
user_pause_access = Enablement.Enabled,
user_windows_update_scan_access = Enablement.Enabled,
update_notification_level = WindowsUpdateNotificationDisplayOption.DefaultNotifications,
allow_windows11_upgrade = True,
)
result = await graph_client.device_management.device_configurations.by_device_configuration_id('deviceConfiguration-id').patch(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。