Author Posts

February 5, 2016 at 7:01 am

Anyone know how to use Powershell to deselect the "Move deleted files to Conflict and Deleted folder" ? From the GUI its in the advanced tab of the replication memberships properties. I haven't been able to figure it out.

February 6, 2016 at 7:13 am

I can't see a way to do this with any of the cmdlets but poking about with ADSIEdit and the AD provider I've found that unchecking the box changes the msDFSR-Options attribute value from 0 to 2.

If you navigate to the DSFR-LocalSettings container which you'll find in the Computer object container you can use Set-ItemProperty to change the value:

cd AD:                   
cd '.\DC=contoso,DC=com'      
cd '.\OU=Domain Controllers'
cd .\CN=LU-DC1
cd .\CN=DFSR-LocalSettings
cd .\CN=bce541f3-affb-4529-a68a-91629cc6e4af
Set-ItemProperty -Path .\CN=bce541f3-affb-4529-a68a-91629cc6e4af -Name msDFSR-Options -Value 2

February 8, 2016 at 6:20 am

Matt,

Thanks for the reply. I never would have found that. Appreciate your help on this one.

Kreston

February 8, 2016 at 6:34 am

My Script to change all DFSR replicated folder to not use conflicts and deleted

$WEB01 = "ServerName"
        Set-Location "AD:\CN=DFSR-LocalSettings,CN=$WEB1,CN=Computers,DC=domain,DC=com"
        $DFSRSHARES = Get-ADObject -Identity "CN=DFSR-LocalSettings,CN=$WEB1,CN=Computers,DC=domain,DC=com" | Get-ChildItem | Select-Object Name -ExpandProperty Name | Out-File C:\Temp\\DFSR_Repl_Web1.txt
        $DFSRSHARES = Get-Content C:\Temp\DFSR_Repl_Web1.txt
        ForEach ($DFSRSHARE in $DFSRSHARES)
            {
                $Subscription = Get-ChildItem -Path "AD:\CN=$DFSRSHARE,CN=DFSR-LocalSettings,CN=$WEB1,CN=Computers,DC=domain,DC=com"  | Select-Object Name -ExpandProperty Name
                Set-ItemProperty -Path "AD:\CN=$Subscription,CN=$DFSRSHARE,CN=DFSR-LocalSettings,CN=$WEB1,CN=Computers,DC=domain,DC=com" -Name msDFSR-Options -Value 2
            }