Set-CMDatabaseProperty
Set-CMDatabaseProperty
Changes database settings for a Configuration Manager database.
Syntax
Parameter Set: SearchBySiteCode
Set-CMDatabaseProperty -SiteCode <String> [-DataRetentionPeriodDays <Int32> ] [-EnableDataCompression <Boolean> ] [-SqlServerServiceBrokerPort <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Set-CMDatabaseProperty cmdlet changes database settings for a Microsoft System Center 2012 Configuration Manager site database. Specify the System Center 2012 Configuration Manager site code for the database that you want to modify.
You can modify whether the database uses data compression, the Service Broker port for the computer that runs Microsoft SQL Server, and the length of time that the database keeps data. You can use the Get-CMDatabaseProperty cmdlet to see current values for these properties.
Parameters
-DataRetentionPeriodDays<Int32>
Specifies a length of time, in days, that the database stores data. After data exceeds this period, the database removes it during the next scheduled grooming.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-EnableDataCompression<Boolean>
Specifies whether the database uses data compression.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SiteCode<String>
Specifies the site code for a Configuration Manager site.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SqlServerServiceBrokerPort<Int32>
Specifies the port that the computer running SQL Server uses as a Service Broker port.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Change settings for a database
This command makes changes to the database for the site that has the site code CM2. The command sets the data retention period to 10 days, disables data compression, and specifies a port for the SQL Server Service Broker.
PS C:\> Set-CMDatabaseProperty -SiteCode "CM2" -DataRetentionPeriodDays 10 -EnableDataCompression $False -SqlServerServiceBrokerPort 80