HI @Jean Paul Larach,
One possible way to get the video thumbnails from a SharePoint document library using PowerShell is to use the SharePoint CSOM API.
The CSOM API provides a method called GetFileByServerRelativeUrl that can be used to get a reference to a file in a document library.
Then, you can use the ListVideoThumbnails method to get a collection of thumbnails for the video file. You can also specify the width and height of the thumbnails you want to retrieve.
This is just a code template for your reference. For specific situations, you need to modify the code according to your scenario.
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
$SiteUrl = “https://contoso.sharepoint.com/sites/videosite” $VideoFileUrl = “/sites/videosite/Shared Documents/MyVideo.mp4”
$UserName = “user@contoso.com” $Password = “password”
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword) $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) $Context.Credentials = $Credentials
$VideoFile = $Context.Web.GetFileByServerRelativeUrl($VideoFileUrl) $Context.Load($VideoFile) $Context.ExecuteQuery()
$Thumbnails = $VideoFile.ListVideoThumbnails(200, 200) # Specify the width and height of the thumbnails $Context.Load($Thumbnails) $Context.ExecuteQuery()
foreach ($Thumbnail in $Thumbnails) {
Write-Host $Thumbnail.ServerRelativeUrl
}
$Context.Dispose()
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards
Cheng Feng