PowerShell script exchange
Post Reply
RodolfoGiovanninetti
Novice
Posts: 3
Liked: never
Joined: Feb 17, 2020 1:03 pm
Full Name: Rodolfo Giovanninetti
Contact:

PowerShell / SQL query to find a file?

Post by RodolfoGiovanninetti »

Using Veeam Backup & Replication, is it possible to use a script / query to find a file to restore?
I work in the IT department of my company.
Sometimes people ask me to restore a file.
But, they do not know neither the exact name nor when it was deleted.
I can understand their point of view.
Just for example, there is a file that is used at the end of each month, and only once per month.
My colleagues go to that folder and open the file, without looking at its "exact" name, just a double-click.
Now, they found out that the file has disappeared and is no longer there.
What was it exact name?
They do not remember.
When it was deleted?
They do not know, last month, when they used it, it was there, now it is there no longer.
So, I would like to know if it is possible to query the database through SQL or PowerShell to find filenames such as "*abc*" that contain some characters.
They are not sure even of the folder name: it was one of the sub-folder of "invoices", but which one?
Is it possible to look for these information with a script/query?
Starting from a partial name to look for folder and in which jobs it was included.
I searched in this forum and internet, but I was not able to find an answer, maybe I di not type the correct question.
Thank You and regards
Rodolfo Giovanninetti
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: PowerShell / SQL query to find a file?

Post by oleg.feoktistov »

Hi Rodolfo and Welcome to the Community Forums!

Tell me, please, which type of backup jobs you are speaking of?

Thanks!
Oleg
RodolfoGiovanninetti
Novice
Posts: 3
Liked: never
Joined: Feb 17, 2020 1:03 pm
Full Name: Rodolfo Giovanninetti
Contact:

Re: PowerShell / SQL query to find a file?

Post by RodolfoGiovanninetti »

I am talking about files that are/were on windows file server, that is a virtual machine inside vmware.

Thank You and regards

Rodolfo Giovanninetti
PetrM
Veeam Software
Posts: 3626
Liked: 608 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: PowerShell / SQL query to find a file?

Post by PetrM »

Hi Rodolfo,

I think there is no table in our configuration database which contains information about guest OS files.
I'd suggest to take a look at this thread, there are some useful tips to get a list of guest files via file level restore.

Thanks!
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: PowerShell / SQL query to find a file?

Post by oleg.feoktistov » 2 people like this post

Yep, Petr is right.
You would need to mount a restore point to query for guest os files.
Then, if the file name is unknown but you have at least a part of the name /what it is about or the location
the file was likely to had been maintained in, after mounting some backup you can construct a regular expression to help you look up:

Code: Select all

gci -Path 'C:\VeeamFLR\<ServerName>_id\Volume1' | ? -FilterScript {$_.name -match “*abc|def”}
RodolfoGiovanninetti
Novice
Posts: 3
Liked: never
Joined: Feb 17, 2020 1:03 pm
Full Name: Rodolfo Giovanninetti
Contact:

Re: PowerShell / SQL query to find a file?

Post by RodolfoGiovanninetti »

Thank You all, it seems that it is not possible to do what I wanted.
If I understand, to mount a restore point I need to choose a date.
For example, the backup that was done yesterday.
Then I can check to see if I find the file.
If not, I have to mount the backup of the day before yesterday, and search again.
But I do not know which date I have to use.
I hoped to be able to find all filenames in a table with different dates and look in there.

Thank You again and regards

Rodolfo Giovanninetti
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: PowerShell / SQL query to find a file?

Post by oleg.feoktistov »

Thank You all, it seems that it is not possible to do what I wanted.
If I understand, to mount a restore point I need to choose a date.
Correct. Backup server does keep guest file indexes in case you enabled indexing for a particular job,
but it only helps you search OS files in the Recovery Session UI of the mounted restore point.
Thanks!
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests