Using this template helps us debug your issues more effectively
Description
I wrote a powershell script using the fantastic PSZoom module created by @maci01 (Profile - maci01 - Zoom Developer Forum) but for reasons inexplicable to me, it gets a randome subset of the available meetings to download.
NOT useful.
Error
No specific error, although I do seem to get an awful lot of “recording does not exist” and I cannot explain that either.
Which App Type (OAuth / Chatbot / JWT / Webhook)?
Oauth for the PSzoom module and JWT for the download link
How To Reproduce (If applicable)
Steps to reproduce the behavior:
run the script:
#pre-reqs, PSZoom powershell module, an admin account on zoom, your oauth set and your JWT Auth set.
#update this to match your environment - you will need a JWT token, and they expire regularly, https://marketplace.zoom.us/develop/apps/[APPID]/feature
#you will need your from and to dates, your download location,
#and to choose if you want auto delete (change no to yes AND uncomment the remove section on line 38
import-module PSZoom
$Global:ZoomApiKey = 'REDACTED FOR SAFETY'
$Global:ZoomApiSecret = 'REDACTED FOR SAFETY'
$base = "C:\working\Testing\"
$fromfile1 = "C:\working\zoomusers_$((Get-Date).ToString('MM-dd-yyyy')).csv"
$fromfile2 = "c:\working\rcdngs_$((Get-Date).ToString('MM-dd-yyyy')).csv"
$fromfile3 = "c:\working\DWNLD_$((Get-Date).ToString('MM-dd-yyyy')).csv"
$downlog = "c:\working\ZoomDownloads_$((Get-Date).ToString('MM-dd-yyyy')).log"
$deletelog = "c:\working\ZoomDelete_$((Get-Date).ToString('MM-dd-yyyy')).log"
$exportPath = 'c:\working\files\'
$jwt='REDACTED FOR SAFETY'
$AToken='/?access_token='
$autodelete= 'NO'
$count=0
$FDATE="2021-11-11"
$TDATE="2022-02-28"
Get-ZoomUsers -AllPages -status active | Where-Object {$_.type -eq "2"} |Select-Object id,first_name,last_name,email,pmi | export-csv $fromfile1 -NoTypeInformation
write-host "obtained users"
$Users = Import-Csv -Path $FromFile1
Write-Host "getting recording list"
foreach ($user in $Users) {
Get-zoomRecordings -userId $user.email -From $FDATE -PageSize 300 -To $TDATE |Select-Object -ExpandProperty meetings| export-csv -append $fromfile2 -NoTypeInformation
$MIDS = Import-Csv -Path $fromfile2
foreach ($MID in $MIDS) {
Get-ZoomMeetingRecordings -MeetingId $MID.uuid | Select-Object -property topic,start_time -ExpandProperty recording_files| Select-Object -property topic,start_time,meeting_id,download_url| export-csv $fromfile3 -Append -NoTypeInformation
$count=$count+1
}
}
write-host "got recording list, $count items long"
Write-Host "converting to download links, and begining downloads"
$Links = Import-Csv -Path $fromfile3
foreach ($Link in $Links) {
$MTD = $Link.start_time.substring(0,10)
$path = ($base + $Link.topic)
If(!(test-path $path))
{
New-Item -ItemType Directory -Force -Path $path
}
$uri= ($link.download_url + $AToken + $jwt)
$inc = 1
$file=($path + "\" + $mtd + "-" + $inc + ".mp4")
If(!(test-path $file)) {
$wc=New-Object System.Net.WebClient
$wc.DownloadFile($uri,$file)
Write-Output "downloading $file" | out-file $downlog -append}
else {
$items=(Get-ChildItem $path | Measure-Object).Count
$inc=$inc+$items
$file=($path + "\" + $mtd + "-" + $inc + ".mp4")
$wc=New-Object System.Net.WebClient
$wc.DownloadFile($uri,$file)
Write-Output "downloading $file" | out-file $downlog -append}
if($autodelete -eq 'YES'){
#Remove-ZoomMeetingRecordings -MeetingId $link.meeting_id -Action delete
Write-Output ($link.topic + " on " + $MTD + " was succesfully delted on $((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss'))") | out-file $deletelog -append
}
}
Screenshots (If applicable)
This is what Zoom shows I have for recordings, 68 items.
(Dev Forums says I cant embed media items)
but the script outputs only 4 downloadable items (sometimes 2, sometimes 6, but nothing specific), regardless of time frame chosen.
Additional context
What am i doing wrong?