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

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Copy-SqlSpConfigure

This command copies configuration values (sp_configure) from one SQL Server to another. By default, all configuration values are copied.

The -Configs parameter is autopopulated for command-line completion and can be used to copy only specific configs.

Examples

To copy all sp_configure settings from sqlserver2014a to sqlcluster using integrated (Windows) authentication

To update the values for two configs, the IsSqlClrEnabled and DefaultBackupCompression, from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and Windows credentials for sqlcluster

To see what would happen if the command were executed

Get-Help

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

Source Code

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

Related commands