dbatools is a free PowerShell module with over 300 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


Registers an existing configuration object in registry.
This allows simple persisting of settings across powershell consoles.
It also can be used to generate a registry template, which can then be used to create policies.




Retrieves all configuration items that that start with message. and registers them in registry for the current user.

Get-DbaConfig message.* | Register-DbaConfig

Retrieves the configuration item “developer.mode.enable” and registers it in registry as the default setting for all users on this machine.

Register-DbaConfig -FullName “developer.mode.enable” -Scope SystemDefault

Retrieves all configuration items of the module MyModule, then registers them in registry to enforce them for all users on the current system.

Register-DbaConfig -Module message -Scope SystemMandatory


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


From PowerShell, execute Get-Help Register-DbaConfig -Detailed for more information on this function.

Source Code

Want to see the source code? View Register-DbaConfig.ps1 on GitHub

Related commands