10-26-2017 09:47 PM
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
10-26-2017 11:57 PM
Hi Bruce,
You can try the following powershell command :
gci $YourPath -recurse | where {$_.attributes -match "SparseFile"}
Regards,
Antoine
10-27-2017 05:08 AM
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
10-27-2017 06:50 AM - edited 10-27-2017 07:02 AM
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:
--Chris
10-30-2017 03:54 AM
Thanks guys, I appreciate the feedback :)