Set-sqmSqlPolicyState
Other sqmSQLTool v1.8.2+
Enables or disables a single Policy-Based Management policy on a SQL Server instance.

Examples

Set-sqmSqlPolicyState -SqlInstance "SQL01" -Policy "xp_cmdshell must be disabled" -State Disable
Set-sqmSqlPolicyState -SqlInstance "SQL01" -Policy "xp_cmdshell must be disabled" -State Disable
"SQL01","SQL02" | Set-sqmSqlPolicyState -Policy "Password Policy" -State Enable
"SQL01","SQL02" | Set-sqmSqlPolicyState -Policy "Password Policy" -State Enable