Microsoft's official enterprise support blog for AD DS and more
Ned here again. Today I’m going to talk about a couple of scenarios we run into with the ConflictAndDeleted folder in DFSR. These are real quick and dirty, but they may save you a call to us someday.
Scenario 1: We need to empty out the ConflictAndDeleted folder in a controlled manner as part of regular administration (i.e. we just lowered quota and we want to reclaim that space).
Scenario 2: The ConflictAndDeleted folder quota is not being honored due to an error condition and the folder is filling the drive.
Let’s walk through these now.
Emptying the folder normally
It’s possible to clean up the ConflictAndDeleted folder through the DFSMGMT.MSC and SERVICES.EXE snap-ins, but it’s disruptive and kind of gross (you could lower the quota, wait for AD replication, wait for DFSR polling, and then restart the DFSR service). A much faster and slicker way is to call the WMI method CleanupConflictDirectory from the command-line or a script:
1. Open a CMD prompt as an administrator on the DFSR server. 2. Get the GUID of the Replicated Folder you want to clean:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderconfig get replicatedfolderguid,replicatedfoldername
(This is all one line, wrapped)
3. Then call the CleanupConflictDirectory method:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='<RF GUID>'" call cleanupconflictdirectory
Example output with a sample GUID:
WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='70bebd41-d5ae-4524-b7df-4eadb89e511e'" call cleanupconflictdirectory
4. At this point the ConflictAndDeleted folder will be empty and the ConflictAndDeletedManifest.xml will be deleted.
Emptying the ConflictAndDeleted folder when in an error state
We’ve also seen a few cases where the ConflictAndDeleted quota was not being honored at all. In every single one of those cases, the customer had recently had hardware problems (specifically with their disk system) where files had become corrupt and the disk was unstable – even after repairing the disk (at least to the best of their knowledge), the ConflictAndDeleted folder quota was not being honored by DFSR.
Here’s where quota is set:
Usually when we see this problem, the ConflictAndDeletedManifest.XML file has grown to hundreds of MB in size. When you try to open the file in an XML parser or in Internet Explorer, you will receive an error like “The XML page cannot be displayed” or that there is an error at line X. This is because the file is invalid at some section (with a damaged element, scrambled data, etc).
To fix this issue:
For a bit more info on conflict and deletion handling in DFSR, take a look at:
Staging folders and Conflict and Deleted folders (TechNet) DfsrConflictInfo Class (MSDN)
Until next time...
- Ned "Unhealthy love for DFSR" Pyle
great. I actually was looking for this today, because we had an issue where the "normal" cleanup for some reason did not occur and 130 GB of data was roaming around the ConflictAndDeleted folder. The WMI call did the trick, thanks.
There will be a small service fee for my psychic powers. :)
Now that you´re into the cleaning business =), what about the Staging folder under DfsrPrivate folder.
Are there any special considerations to have in mind if you want to clean that folder if there is data that seems to be stuck in it.
Thank you very much for the info. our DFS conflict folder bloated to a massive 130GB, and it almost gave me a panic attack! :P
I initially tried the WMI script, weirdly enough, it did not work (gasp!)
I am now doing a manual delete (DEL command), cross fingers and toes that it works as planned and won't bring down our infra. :P
will update the blog again.
Thanks Ned for your tip. it worked and our DFS is now back to a stable size.
Ok, bump into this one...
I seem to have a problem with doing the initial command (the one where we get the GUIDs).
My namespace is \\rodic.com\dfs, when I do the path dfsrreplicatedfolderconfig part I get an error 0x8004100e INVALID NAMESPACE .
Hmm, any ideas? What am I doing wrong?
Since you didn't post your syntax I cannot be sure. It sounds like you are confusing your DFS Namespace with the WMI namespace of the command. You do not need to alter the command line to obtain the Replicated folder GUIDs. Run it as is.
The same is true for the command that you run to purge the ConflictAndDeleted folder. The Namespace we are targeting with WMIC is the WMI namespace "\\root\microsoftdfs" not your DFS Namespace. For example:
wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='81CD0A52-F132-4A91-BEF7-205262F526BA'" call cleanupconflictdirectory.
The only portion of command line you need to change is the GUID "81CD0A52-F132-4A91-BEF7-205262F526BA" with your replicated folder's GUID.
wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='Darko's RF GUID goes here'" call cleanupconflictdirectory.
This KB also explains how to run the command. http://support.microsoft.com/default.aspx?scid=kb;EN-US;951010
Did this command work in windows server 2008 DFS? I'd submit it as below. But nothing to happen with conflict folder pass 12 hour.
C:\>wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "rep
licatedfolderguid='9CEE25F4-E557-48A8-8933-0D2F79F2E2CB'" call cleanupconflictdi
Method execution successful.
instance of __PARAMETERS
ReturnValue = 0;
I do it again and work now. I'm not sure that what's happen. Anywey,Thanks!
I stumbled on this article by accident but it prompted me to check my folder sizes. Turned out I had several that had exceeded their quotas many times over.
This was on a Server 2003 R2 so I wasn't sure if your trick would work. It did brilliantly though so thanks very much.
It would be great to work this little function into a button on the GUI (as shown on your 3rd image)
"It would be great to work this little function into a button on the GUI (as shown on your 3rd image)"
Agreed. Maybe someday...