dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Export-SqlSpConfigure

This command exports advanced sp_configure global configuration options in SQL format to a file.

Examples

To export sp_configure values in SQL format to C:\temp\sp_configure.sql using integrated (Windows) authentication to login to the server

To export sp_configure values in SQL format to C:\temp\sp_configure.sql using SQL authentication to login to the server (you will be prompted for sqladmin’s password)

Get-Help

From PowerShell, execute Get-Help Export-SqlSpConfigure -Detailed for more information on this function.

Source Code

Want to see the source code? View Export-SqlSpConfigure.ps1 on GitHub
 

Related commands