How to Use DSC to Disable UAC Completely From Windows Server 2012

Goal:  You want to use DSC to disable UAC (User Account Control) completely.
Scenario:  You are using PowerShell version 4 and Windows Server 2012.  (The solution may work for different versions.)
You tried to use the configuration found here:

"Configuration NeverNotifyAndDisableAll
{
    Import-DSCResource -Module MSFT_xSystemSecurity -Name xUac

    Node localhost
    {
        xUAC NeverNotifyAndDisableAll
        {
            Setting = "NeverNotifyAndDisableAll"
        }
    }
}
"

When you run the above as a .ps1 file, you will see a message that says "Unexpected token '}'" error.  When it happened to me, I tried moving the "Import-DSCResource" to be under the "Node" section.  When I ran the .ps1 file, I received a message about "The term 'Import-DSCResource is not recognized..."

Solution:  Leave the code alone except for one change: eliminate the "MSFT_" portion. 

Leave a comment

Your email address will not be published. Required fields are marked *