Skip to content

Instantly share code, notes, and snippets.

@jschlackman
Created August 28, 2023 20:06
Show Gist options
  • Save jschlackman/106e2670b7181ad2288ed990d3615b17 to your computer and use it in GitHub Desktop.
Save jschlackman/106e2670b7181ad2288ed990d3615b17 to your computer and use it in GitHub Desktop.
# Remove the erroneous temporary flag from any GPO files on the current DC. Fixes issues listed in the DFSR diagnotic log as:
#
# "DFS Replication does not replicate certain files in the replicated folders listed above because they have temporary attribute set, or they are symbolic links."
Get-ChildItem "$env:SystemRoot\SYSVOL\domain\Policies" -recurse | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment