< Back

Get-DbaSpConfigure

Mon Jan 13, 2020 11:39 am

NAME Get-DbaSpConfigure



SYNOPSIS

Returns all server level system configuration (sys.configuration/sp_configure) information





SYNTAX

Get-DbaSpConfigure [-SqlInstance] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]> [[-SqlCredential]

<Pscredential>] [[-Name] <System.String[]>] [[-ExcludeName] <System.String[]>] [-EnableException <Switch>]

[<CommonParameters>]





DESCRIPTION

This function returns server level system configuration (sys.configuration/sp_configure) information. The

information is gathered through SMO Configuration.Properties.



The data includes the default value for each configuration, for quick identification of values that may have been

changed.





PARAMETERS

-EnableException [<Switch>]

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.

This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables

advanced scripting.

Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own

try/catch.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ExcludeName [<System.String[]>]

Exclude specific configurations. Name can be either values from (sys.configuration/sp_configure) or from SMO

object



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Name [<System.String[]>]

Return only specific configurations. Name can be either values from (sys.configuration/sp_configure) or from

SMO object



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).



Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory -

Integrated are all supported.



For MFA support, please use Connect-DbaInstance.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlInstance [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

The target SQL Server instance or instances. This can be a collection and receive pipeline input



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

A DbaInstanceParameter representing an array of SQL Server instances.





OUTPUTS

Returns PSCustomObject with properties ServerName, ComputerName, InstanceName, SqlInstance, Name, DisplayName,

Description, IsAdvanced, IsDynamic, MinValue, MaxValue, ConfiguredValue, RunningValue, DefaultValue,

IsRunningDefaultValue





NOTES





Tags: SpConfig, Configure, Configuration

Author: Nic Cain, https://sirsql.net/



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-DbaSpConfigure -SqlInstance localhost



Returns all system configuration information on the localhost.

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>'localhost','localhost\\namedinstance' | Get-DbaSpConfigure



Returns system configuration information on multiple instances piped into the function

-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-DbaSpConfigure -SqlInstance sql2012 -Name 'max server memory (MB)'



Returns only the system configuration for MaxServerMemory on sql2012.

-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-DbaSpConfigure -SqlInstance sql2012 -ExcludeName 'max server memory (MB)', RemoteAccess | Out-GridView



Returns system configuration information on sql2012 but excludes for max server memory (MB) and remote access.

Values returned in grid view

-------------------------- EXAMPLE 5 --------------------------



PS C:\\>$cred = Get-Credential SqlCredential



PS C:\\> 'sql2012' | Get-DbaSpConfigure -SqlCredential $cred -Name RemoteAccess, 'max server memory (MB)'

-ExcludeName 'remote access' | Out-GridView



Returns system configuration information on sql2012 using SQL Server Authentication. Only MaxServerMemory is

returned as RemoteAccess was also excluded.



RELATED LINKS

https://dbatools.io/Get-DbaSpConfigure