Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-CMSiteMaintenanceTask
- Module:
- ConfigurationManager Module
Change settings for a Configuration Manager maintenance task.
Syntax
SetSummaryTaskByName (Default)
Set-CMSiteMaintenanceTask
-SummaryTask <SummaryTask>
[-FixedRun]
[-RunIntervalMins <Int32>]
[-RunNow]
[-PassThru]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetMaintenanceTasksByValue
Set-CMSiteMaintenanceTask
-InputObject <IResultObject>
[-BeginTime <DateTime>]
[-DaysOfWeek <DaysOfWeek[]>]
[-DeleteOlderThanDays <Int32>]
[-DeviceName <String>]
[-EnableAlert <Boolean>]
[-Enabled <Boolean>]
[-LatestBeginTime <DateTime>]
[-SiteBackupPath <String>]
[-SqlBackupPath <String>]
[-PassThru]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetMaintenanceTasksByTaskName
Set-CMSiteMaintenanceTask
-Name <String>
[-BeginTime <DateTime>]
[-DaysOfWeek <DaysOfWeek[]>]
[-DeleteOlderThanDays <Int32>]
[-DeviceName <String>]
[-EnableAlert <Boolean>]
[-Enabled <Boolean>]
[-LatestBeginTime <DateTime>]
[-SiteBackupPath <String>]
[-SqlBackupPath <String>]
[-PassThru]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetMaintenanceTasksByName
Set-CMSiteMaintenanceTask
-MaintenanceTask <MaintenanceTask>
[-BeginTime <DateTime>]
[-DaysOfWeek <DaysOfWeek[]>]
[-DeleteOlderThanDays <Int32>]
[-DeviceName <String>]
[-EnableAlert <Boolean>]
[-Enabled <Boolean>]
[-LatestBeginTime <DateTime>]
[-SiteBackupPath <String>]
[-SqlBackupPath <String>]
[-PassThru]
[-SiteCode <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-CMSiteMaintenanceTask cmdlet changes settings for a Configuration Manager maintenance task. For more information, see Maintenance tasks.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Examples
Example 1: Set a maintenance task to run once a week
This example specifies that the maintenance task named Backup SMS Site Server runs on Friday each week on the Configuration Manager site that has the site code CM1.
Set-CMSiteMaintenanceTask -SiteCode "CM1" -MaintenanceTaskName "Backup SMS Site Server" -DaysOfWeek Friday
Example 2: Configure backup destinations
Set-CMSiteMaintenanceTask -Name $TaskName -SiteBackupPath "c:\site-backup" -SqlBackupPath "c:\sql-backup" -BeginTime (Get-Date) -DaysOfWeek Sunday,Monday -EnableAlert $true -Enabled $true
Parameters
-BeginTime
Specify the date and time at which a maintenance task starts.
Parameter properties
| Type: | DateTime |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-DaysOfWeek
Specify an array of day names that determine the days of each week on which the maintenance task runs.
Parameter properties
| Type: | DaysOfWeek[] |
| Default value: | None |
| Accepted values: | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DeleteOlderThanDays
For maintenance tasks that delete aged data, use this parameter to specify the number of days.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | DeleteOlderThan, DeleteThanOlderDays |
Parameter sets
-DeviceName
Specifies the name of the device on which the maintenance task runs.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableAlert
Set this parameter to $true to enable alerts for task failures, if the task supports it.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | EnabledAlert |
Parameter sets
-Enabled
Indicates whether the maintenance task is enabled in Configuration Manager.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-FixedRun
Indicates that this cmdlet modifies the maintenance task as a fixed run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | FixedRunInterval, DisableFixedRunInterval |
Parameter sets
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InputObject
Specify the maintenance task object to configure. To get this object, use the Get-CMSiteMaintenanceTask cmdlet.
Parameter properties
| Type: | IResultObject |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | MaintenanceTaskObject |
Parameter sets
-LatestBeginTime
Specifies a future date and time at which the maintenance task runs.
Parameter properties
| Type: | DateTime |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MaintenanceTask
Specify the name of a maintenance task to configure.
Parameter properties
| Type: | MaintenanceTask |
| Default value: | None |
| Accepted values: | BackupSiteServer, CheckApplicationTitleWithInventoryInformation, ClearUndiscoveredClients, DeleteAgedApplicationRequestData, DeleteUnusedApplicationRevisions, DeleteAgedClientOperations, DeleteAgedCollectedFiles, DeleteAgedComputerAssociationData, DeleteAgedDeleteDetectionData, DeleteAgedDeviceWipeRecord, DeleteAgedDiscoveryData, DeleteAgedEnrolledDevices, DeleteAgedEndpointProtectionHealthStatusHistoryData, DeleteAgedDevicesManagedByTheExchangeServerConnector, DeleteAgedInventoryHistory, DeleteAgedLogData, DeleteAgedSoftwareMeteringData, DeleteAgedSoftwareMeteringSummaryData, DeleteAgedClientPresenceHistory, DeleteAgedNotificationTaskHistory, DeleteAgedReplicationTrackingData, DeleteAgedReplicationSummaryData, DeleteAgedStatusMessages, DeleteAgedThreatData, DeleteAgedUnknownComputers, DeleteAgedUserDeviceAffinityData, DeleteInactiveClientDiscoveryData, DeleteObsoleteAlerts, DeleteObsoleteClientDiscoveryData, DeleteObsoleteForestDiscoverySitesAndSubnets, EvaluateProvisionedAmtComputerCertificates, MonitorKeys, RebuildIndexes, SummarizeSoftwareMeteringFileUsageData, SummarizeInstalledSoftwareData, SummarizeSoftwareMeteringMonthlyUsageData, DeleteAgedDistributionPointUsageStats, DeleteAgedProxyTrafficData |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specify the name of a maintenance task object to configure.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | True |
| DontShow: | False |
| Aliases: | MaintenanceTaskName, TaskName, ItemName |
Parameter sets
-PassThru
Returns an object representing the item with which you're working. By default, this cmdlet may not generate any output.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-RunIntervalMins
The Set-CMSiteMaintenanceTask cmdlet changes settings for a Configuration Manager maintenance task. For more information, see Maintenance tasks.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | RunIntervalMinutes |
Parameter sets
-RunNow
Add this parameter to have Configuration Manager run the maintenance task immediately.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SiteBackupPath
Applies to version 2010 and later. For the Backup Site Server task, specify the Site backup destination. The site server computer account needs full control to the destination folder.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SiteCode
Specifies the site code of the Configuration Manager site that hosts the site system role.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SqlBackupPath
Applies to version 2010 and later. For the Backup Site Server task, specify the SQL backup destination. The site server computer account needs full control to the destination folder.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SummaryTask
Specifies a summary maintenance task.
Parameter properties
| Type: | SummaryTask |
| Default value: | None |
| Accepted values: | UpdateApplicationCatalogTables |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
IResultObject
Related Links
Feedback
Was this page helpful?
