Create PolicyDefinitions Central Store if it doesn’t already exist using PowerShell

Create PolicyDefinitions Central Store

The below script will check if a central store already exists and if not will move your current PolicyDefinitions folder to the correct location. This will enabled all domain controllers in your domain to reference the same PolicyDefinitions folder. This in turn makes management of and addition of new ADMX files easier as you only ever need to update on location.

        if ( -not (Test-Path "C:\Windows\SYSVOL\domain\Policies\PolicyDefinitions")){
        #Move local files to central store
        robocopy /xc /xn /xo "C:\Windows\PolicyDefinitions" "C:\Windows\SYSVOL\domain\Policies\PolicyDefinitions" /R:5 /W:1 /E
        } else {
           Write-Host "Central store already exists" -ForegroundColor Green

Found priceless insights in this blog? Support the author’s creativity – buy them a coffee!

Leave a Reply

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