Get-MgmtSvcDatabaseSetting

Get-MgmtSvcDatabaseSetting

Reads settings from a configuration database.

Syntax

Parameter Set: Default
Get-MgmtSvcDatabaseSetting [-Namespace] <String> [-Name] <String> [-ConnectionString <String> ] [-Database <String> ] [-Passphrase <String> ] [-Password <String> ] [-Server <String> ] [-UserName <String> ] [ <CommonParameters>]


 

Detailed Description

The Get-MgmtSvcDatabaseSetting cmdlet reads the configuration settings of a management service component from the database. A setting consists of a namespace, a name, and a value. If you protected a setting by encrypting it, you need to supply a value for the Passphrase parameter to decrypt the setting.

You can run this cmdlet from any computer in the deployment. However, this cmdlet assumes that the database is on the local computer. If the database is on another computer, you must use the Server, UserName, Password, and Database parameters, or a SQL connection string. If you specify a connection string by using the ConnectionString parameter, that value takes precedence over the Server, UserName, Password, and Database parameters.

Parameters

-ConnectionString<String>

Specifies an SQL connection string.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Database<String>

Specifies a database name. The Config schema must be in stalled in this database.

By default, the Config schema is installed in the following databases:

-- Microsoft.MgmtSvc.Config

-- Microsoft.MgmtSvc.PortalConfigStore

-- Microsoft.MgmtSvc.Store

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Name<String>

Specifies an array of names for a setting.

 

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

true

 

-Namespace<String>

Specifies an array of namespaces for a setting.

 

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Passphrase<String>

Specifies a passphrase. If a setting was previously encrypted, provide a passphrase to decrypt the setting. A passphrase must be provided if the setting requires it.

By default, only Microsoft.MgmtSvc.Config settings require a passphrase.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Password<String>

Specifies a password for the user to connect to the database.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Server<String>

Specifies the name of the computer on which the SQL database resides.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserName<String>

Specifies the name of a user account used to connect to the database.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

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.

Examples

Example 1: Get a setting

The first command stores a connection string in the $ConnectionString variable.

The second command gets the setting that has the specified namespace, name, and value. A passphrase is supplied to decrypt the setting.

PS C:\> $ConnectionString = 'Data Source=rd-source04;Initial Catalog=Microsoft.MgmtSvc.Config;User ID=SA;Password=PassWord01'
 PS C:\> Get-MgmtSvcDatabaseSetting -Namespace "TenantSite" -Name "machineKey.decryptionKey" -ConnectionString $ConnectionString -Passphrase "PassPhrase01"

 


Related topics

Set-MgmtSvcDatabaseSetting

Test-MgmtSvcPassphrase

Reset-MgmtSvcPassphrase

Get-MgmtSvcDefaultDatabaseName