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


Gets Force Encryption settings for a SQL Server instance. Note that this requires access to the Windows Server – not the SQL instance itself.

This setting is found in Configuration Manager.




Gets Force Encryption properties on the default (MSSQLSERVER) instance on localhost – requires (and checks for) RunAs admin.


Gets Force Network Encryption for the SQL2008R2SP2 on sql01. Uses Windows Credentials to both login and view the registry.

Get-DbaForceNetworkEncryption -SqlInstance sql01\SQL2008R2SP2


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


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

Source Code

Want to see the source code? View Get-DbaForceNetworkEncryption.ps1 on GitHub

Related commands