Are you having trouble replicating with Microsoft DFSR?

At Acumen, one of our technicians was experiencing a problem with the service, too, so he found a solution.

First, let’s describe the problem before we go over the solution.

Problem:

You may see in DFSR Diagnostic Report that files aren’t being replicated due to a Temporary File Attribute being set.

DFSR Note:

Normally, you don’t want to have DFSR replicate those kinds of files. However, normal methods of viewing file attributes DO NOT show this Temporary attribute and cannot remove it.

Disclaimer:

Because of the way the program was written, it’s common to see PDFs with this temporary attribute when the users access the program PDF995.

Solution:

  1. First, find the folder where the file is located.
    • Also, DFS won’t tell you this, so search the drive for the file name.
  2. Next, once you have the absolute path (full file path), next you add it to the following command in a Command Line Interface, or CLI.
    • Use “quotation marks” around the file name if it has spaces in it:

“fsutil usn readdata “F:\Folder Name\Subfolder Name\Filename.pdf”

As a result, the Output of the command is as follows:

a

Major Version : 0x2

Minor Version : 0x0

FileRef# : 0x0021000000002350

Parent FileRef# : 0x0003000000005f5e

Usn : 0x000000004d431000

Time Stamp : 0x0000000000000000 12:00:00 AM 1/1/1601

Reason : 0x0

Source Info : 0x0

Security Id : 0x5fb

File Attributes : 0x120

File Name Length : 0x10

File Name Offset : 0x3c

FileName : test.txt

“File Attributes” is a bitmask that indicates which attributes are set.

In addition, you can tell that the “Temporary” file attribute is set on the file in the above example because it says “0x120”, and 0x100 (Temporary) + 0x20 (Archive) = 0x120.

Furthermore, here are the possible values: 

READONLY        0x1

HIDDEN         0x2

SYSTEM  0x4

DIRECTORY 0x10

ARCHIVE  0x20

DEVICE         0x40

NORMAL         0x80

TEMPORARY 0x100

SPARSE_FILE 0x200

REPARSE_POINT 0x400

COMPRESSED 0x800

OFFLINE 0x1000

NOT_INDEXED 0x2000

ENCRYPTED 0x4000

So to produce the File Attributes bitmask value, simply add up all the values.

In addition, TO REMOVE the temporary attribute use PowerShell [this is for the whole folder]:

Get-childitem “F:\Folder Name\Subfolder Name” -recurse | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}

Finally, you run the “fsutil” command again.

In conclusion, it shows the File Attributes now is 0x20, which means it is fixed.

Acumen is proud to offer you solutions! For more articles about various Microsoft products, browse around our Microsoft partner page.

Click on the link below to read more on the subject of DSFR:

https://msdn.microsoft.com/en-us/library/bb540025(v=vs.85).aspx