Set-MasterDataServicesSystemSetting (Windows PowerShell)

Sets the value of a specified system setting in a Master Data Services database.

Syntax

Set-MasterDataServicesSystemSetting [-Database] <Microsoft.MasterDataServices.Configuration.DatabaseInformation> 
    [-Setting] <Microsoft.MasterDataServices.Services.DataContracts.SystemSetting> [-SettingValue <String>]

Description

Set-MasterDataServicesSystemSetting sets the value of a specified system setting in a Master Data Services database.

Parameters

-Database

The Database parameter is a database information object from Get-MasterDataServicesDatabase. This object contains information about the Master Data Services database to update.

Required?

true

Position?

0

Default Value

none

Accept Pipeline Input

true (ByValue)

Accept Wildcard Characters?

false

-Setting

The Setting parameter is a system setting object that specifies the name of the system setting to update.

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input

true (ByValue)

Accept Wildcard Characters?

false

-SettingValue

The SettingValue parameter is a string that specifies the new value to set for the system setting. If this parameter is not specified, the value in the Setting parameter is used.

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input

true (ByPropertyName)

Accept Wildcard Characters?

false

Inputs and Outputs

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.

Inputs

Microsoft.MasterDataServices.Configuration.DatabaseInformation, Microsoft.MasterDataServices.Services.DataContracts.SystemSetting, System.String

The input is a database information object, a system setting object, and a string to specify a new value for the system setting.

Outputs

None.

Examples

Piping Output and Using Variables

This example pipes the database server information object from Get-MasterDataServicesDatabaseServerInformation to Set-MasterDataServicesSystemSetting. It gets the current value of the Rows Per Batch system setting and then updates the value in the Master Data Services database.

C:\PS> # Get the database server information object
$dbInfo = Get-MasterDataServicesDatabaseServerInformation 
    -ConnectionString 'Data Source=MyServer\MyInstance;Initial Catalog=;Integrated Security=True;User ID=;Password=' | 
    Get-MasterDataServicesDatabase -DatabaseName 'MyDatabase'; 

# Retrieve the current RowsPerBatch system setting
$rowsPerBatchSetting = $dbInfo | Get-MasterDataServicesSystemSettings | where { $_.DisplayName -eq 'Rows Per Batch'};

# Display the current value of RowsPerBatch
write-host The current setting for RowsPerBatch is $rowsPerBatchSetting.SettingValue;

# Pipe the dbInfo object and set the setting value using the SettingValue parameter
$dbInfo | Set-MasterDataServicesSystemSetting  -Setting $rowsPerBatchSetting -SettingValue '60';

# Retrieve the setting again to see if it was properly updated.
$newRowsPerBatch = $dbInfo | Get-MasterDataServicesSystemSettings | where { $_.DisplayName -eq 'Rows Per Batch' };

# Display the new value of RowsPerBatch.
write-host The new setting for RowsPerBatch is $rowsPerBatchSetting.SettingValue;