Maintain control of your Microsoft 365 data
Post Reply
blongh
Service Provider
Posts: 11
Liked: never
Joined: Mar 11, 2020 3:21 pm
Contact:

Find Item with PowerShell

Post by blongh »

Greetings,

Is it possible to look for a specific item in a repository via PowerShell? I am not able to find any version of a document I am looking for when using the SharePoint Explorer, I was hoping it was possible to script something to find a document by name.

Thanks,
Brian
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Find Item with PowerShell

Post by nielsengelen »

It is possible to do this. You will need to start multiple restore sessions and “browse” through each session. Direct search in the repository is not possible (we don’t do indexing of data). Would this just be searching for the file name? I don’t have a script like this at the moment (only for Exchange) but could come up with one if you give me some time :-)
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
blongh
Service Provider
Posts: 11
Liked: never
Joined: Mar 11, 2020 3:21 pm
Contact:

Re: Find Item with PowerShell

Post by blongh »

Hi @nielsengelen

Thanks, I stumbled on to this documentation:
https://helpcenter.veeam.com/docs/backu ... ml?ver=100

Using Example 6 I tried the following and I get an error

Script
$session = Get-VBOSharePointItemRestoreSession
$organization = Get-VESPOrganization -Session $session -Name * (wildcard because entering a name returned an error also)
$site = Get-VESPSite -Organization $organization -Name "Retail"
Get-VESPDocument -Site $site -Query "20200923 1646 MST.docx"

Error
Get-VESPDocument -Site $site -Query "20200923 1646 MST.docx"
Get-VESPDocument : Attempt by method 'Veeam.SharePoint.Search.SearchFolders.WebFolder+<GetFolders>d__10.MoveNext()' to access method
'Veeam.SharePoint.Interfaces.Extensions.WebExtension.GetListPresentations(Veeam.SharePoint.Interfaces.Objects.IWeb, Boolean)' failed.
At line:1 char:1
+ Get-VESPDocument -Site $site -Query "20200923 1646 MST.docx"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VESPDocument], MethodAccessException
+ FullyQualifiedErrorId : System.MethodAccessException,Veeam.SharePoint.PowerShell.Cmdlets.Items.GetVESPDocument
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests