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
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
SetMaintenanceTasksByTaskName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
SetSummaryTaskByName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
SetSummaryTaskByName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
SetMaintenanceTasksByValue
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
SetMaintenanceTasksByTaskName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
SetMaintenanceTasksByName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
SetMaintenanceTasksByValue
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
SetMaintenanceTasksByTaskName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
SetMaintenanceTasksByName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SummaryTask
Specifies a summary maintenance task.
Parameter properties
Type:
SummaryTask
Default value:
None
Accepted values:
UpdateApplicationCatalogTables
Supports wildcards:
False
DontShow:
False
Parameter sets
SetSummaryTaskByName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
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.