PowerShell Scripting Disclaimer:
This script is provided "as is" for the purpose of illustrating how product tasks may be performed in conjunction with PowerShell. Support shall not be liable for any direct, indirect, incidental, consequential, or other damage alleged in connection with the furnishing or use of this script or of the principles it demonstrates. See PowerShell Scripting Support for more information.
Mount a recovery point first. It is recommended to do it in a directory with a short name (i.e. c:\M) to avoid possible complications caused by long path names. Once it is mounted, you can easily find the folder using powershell.
The process is as follows.
1. Mount the volume to a folder easy to reach i.e. c:\M
2. Set the path to the root of the mounted volume
i.e. cd c:\M
3. Run the following commandlets. (Comments are marked with #)
$foldername = "" #(i.e. $foldername = "*FixedAssets*")
$folderlist = Get-ChildItem -Recurse | Where { $_.PSIsContainer } | Select-Object FullName #to get the list of all folders with the whole PATH
Please note that, especially on system volumes some folders will not be retrieved due to security issues (i.e. C:\Windows\System32\LogFiles\WMI\RtBackup). You will get error messages but the process will continue until all accessible folders are retrieved.
I would recommend keeping the error messages as some highly secured folders containing data may fall into this category. If it is not the case and you desire to avoid any error messages, you can run
$folderlist = Get-ChildItem -Recurse -ErrorAction SilentlyContinue | Where { $_.PSIsContainer } | Select-Object FullName
#>
4. Run
foreach ($folder in $folderlist){if ($folder -like $foldername){Write-host $folder; break}} #this command line gets the first occurrence of your folder and exits; this is the most common case
#remove "break" to get all folders containing that name (this is up to you)
5. In this example the result is
@{FullName=C:\Accounting\MonthlyDepreciation\FixedAssets}
Please note:
A. In most cases the scenario is as follows: one user has inadvertently MOVED the folders to searched to a different location in the folder structure and another user has deleted it not knowing what it is. Thus, the search may find the folder in an unexpected location.
B. It is possible to mount and dismount recovery points from Powershell as well but, due to the asynchronous nature of the operation, there is no reliable way to find out when a recovery point has finished mounting. (It may be possible to do via the API though)
© 2023 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy