Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to inventory based on file age a huge NAS. Some folders are restricted, and only users or groups have rights.

As you probably know Treesize is the best solution, the only problem I found is that if I want to script it it only takes a screenshot instead of writing the information to a text file. (If done through the GUI I'm allowed to copy/paste into text, but I need to script it, several shares).

Robocopy /l lists the files but I also need to know the dates (last access / last modify)

I saw a kernel driver by hobeanu to bypass ntfs permissions.

But do you know any easier way to bypass ntfs permissions? or any other application that allows this type of request and save the information to a text file. (scriptable)


share|improve this question

2 Answers 2

If NTFS file permissions could be "bypassed", they would be useless.

You need to perform any such operation with credentials that posess at least the "read attributes" and "traverse folders" rights.

I'm sure this can be done in Powershell.

share|improve this answer
If you have backup/restore privilege (typically because you are running as administrator) and if the program you are using is designed to do so, you can bypass NTFS file permissions. –  Harry Johnston Mar 21 '12 at 1:44
This would be a specific permission - one of the 29 badly documented possibilities ? :) –  adaptr Mar 21 '12 at 8:24
Backup privilege is listed under "Back up files and directories" in User Rights Assignment in the group policy editor, and known to programmers as SeBackupPrivilege or SE_BACKUP_NAME. Restore privilege is similar. Which you need depends on what specific operation you're trying to do. –  Harry Johnston Mar 22 '12 at 2:15
By default, the Administrators group and the Backup Operators group possess both privileges. –  Harry Johnston Mar 22 '12 at 2:18
If "Backup files" is a specific privilege, then no, you are not bypassing NTFS permissions - you're merely assigned an explicit one. –  adaptr Mar 22 '12 at 10:03

How about this:

 robocopy /e /b /create x:\ c:\working\nascopy /np /unilog:c:\working\nas.log

where x:\ is the NAS and c:\working a scratch directory? The /b option causes robocopy to use backup privilege, bypassing NTFS permissions (if the NAS supports this) and the /create option stops it from trying to actually copy the data. What you'll wind up with is a copy of the directory structure, with file contents and security permissions stripped out, but the filenames and timestamps preserved.

The major catch is that this doesn't preserve the file sizes - but they are recorded in the log file, so it should be possible to put the two pieces of information back together if you need to.

Alternatively, depending on what you're doing, you might be able to use the /L option to robocopy (as you already noted) but in combination with /maxage and /minage (and/or /maxlad and /minlad) to filter the results to the age bracket(s) you're interested in.

share|improve this answer
I don't think the "backup files and directories" right is translated for the nas. What switches like /b do is "enable" the right with the local windows os, which is disabled by default. If /b worked, this would enable anyone with local administrator access on their workstation to grant themselves the right, and circumvent the nas security. –  Greg Askew Mar 25 '12 at 8:50
@GregAskew: If the NAS is running Microsoft Windows this will work. Of course, you have to have backup privilege on the NAS, not just on your own workstation. (It should work for the OP; he's already doing something similar with a third party tool, it just doesn't provide the reporting he needs.) –  Harry Johnston Mar 25 '12 at 22:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.