cancel
Showing results for 
Search instead for 
Did you mean: 

Searching for Offline Files\Placeholders

Bruce_Cranksh1
Level 6
Partner Accredited

Hi All

What would be an effective way to  initiate a search against a file server, Windows 2012,  to see if there are Placeholders?

I am looking for the commands I could use from the CMD prompt, or other way,  to do this seach so that Placeholders\Offline files are displayed

 

Thanks 

 

4 REPLIES 4

Titoine31
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi Bruce,

You can try the following powershell command :

gci $YourPath -recurse | where {$_.attributes -match "SparseFile"}

Regards,

Antoine

Hi,

This should also work on 2012 and will give the full UNC path- 

gci  \\server\share -recurse | where {$_.attributes -match "offline"} | Select Fullname > c:\offlinefiles.txt

Output would be the following: 

FullName
--------
\\sp01\RecallLab\WindowsRecallArchivePoint\LargeUpdated\EV12_CADA_TOI.zip
\\sp01\RecallLab\WindowsRecallArchivePoint\LargeUpdated\EV12_Classification_TOI_Final.zip

Regards,

Patrick 

Antoine, I think you're thinking of ReparsePoint, not SparseFile. The latter is not an attribute related to EV placeholders.

 

To test for FSA placeholders, we should check for both the ReparsePoint and Offline attributes. Outside of EV, there are other uses for offline files, and there are other uses for ReparsePoints, so each of these attributes is necessary but not sufficient for identifying a placeholder.

As long as you're using PowerShell 3.0 or later (and if you're on a supported EV version, you will be), you can use the -Attributes parameter of Get-ChildItem to query for files with both attributes:

Get-ChildItem -Path \\Server\Share -Recurse -Attributes ReparsePoint+Offline

This approach also has the advantage of early filtering, meaning that the FileSystem provider returns only the matching items to the Pipeline. Compare this to the above options where the FileSystem provider returns all items and then the Pipeline passes them to Where-Object, which then filters them. On my (admittedly small) lab data set, using early filtering is consistently faster:

 Capture.JPG

--Chris

 

 

 

Bruce_Cranksh1
Level 6
Partner Accredited

Thanks guys, I appreciate the feedback :)