Get‑SqlDscConfigurationOption - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Get server configuration option metadata or raw SMO objects.

SYNTAX

Metadata (Default)

Get-SqlDscConfigurationOption -ServerObject <Server> [-Name <String>] [-Refresh]
 [<CommonParameters>]

Raw

Get-SqlDscConfigurationOption -ServerObject <Server> [-Name <String>] [-Raw] [-Refresh]
 [<CommonParameters>]

DESCRIPTION

This command gets configuration options from a SQL Server Database Engine instance. By default, it returns user-friendly metadata objects with current values, ranges, and dynamic properties. Use the -Raw switch to get the original SMO ConfigProperty objects.

EXAMPLES

EXAMPLE 1

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Get-SqlDscConfigurationOption

Get metadata for all available configuration options.

EXAMPLE 2

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Get-SqlDscConfigurationOption -Name '*threshold*'

Get metadata for configuration options that contain the word "threshold".

EXAMPLE 3

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Get-SqlDscConfigurationOption -Name "Agent XPs"

Get metadata for the specific "Agent XPs" configuration option.

EXAMPLE 4

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Get-SqlDscConfigurationOption -Raw

Get all configuration options as raw SMO ConfigProperty objects.

PARAMETERS

-Name

Specifies the name of the configuration option to get. Supports wildcards. If not specified, all configuration options are returned.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Raw

Specifies that the original SMO ConfigProperty objects should be returned instead of the enhanced metadata objects.

Type: SwitchParameter
Parameter Sets: Raw
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Refresh

Specifies that the ServerObject's configuration property should be refreshed before trying get the available configuration options. This is helpful when run values or configuration values have been modified outside of the specified ServerObject.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ServerObject

Specifies current server connection object.

Type: Server
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.SqlServer.Management.Smo.Server

SQL Server Management Objects (SMO) Server object representing a SQL Server instance.

OUTPUTS

PSCustomObject[]

Returns user-friendly metadata objects with configuration option details (default behavior).

Microsoft.SqlServer.Management.Smo.ConfigProperty[]

Returns raw SMO ConfigProperty objects when using the -Raw parameter.

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️