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>]
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.
Specifies an SQL connection string.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
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"
Get-MgmtSvcDefaultDatabaseName