Powershell Script to list ALL videos in your 365 Stream environment

%3CLINGO-SUB%20id%3D%22lingo-sub-1752149%22%20slang%3D%22en-US%22%3EPowershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1752149%22%20slang%3D%22en-US%22%3E%3CP%3EI%20hope%20this%20is%20useful%20to%20everyone.%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20goal%20was%20to%20get%20a%20list%20of%20all%20videos%20in%20my%20stream%20so%20that%20I%20could%20contact%20each%20video%20creator%20about%20the%20changes%20that%20are%20coming%20to%20stream.%20Also%20so%20I%20could%20figure%20out%20how%20much%20work%20there%20was%20to%20do%20in%20moving%2C%20and%20how%20much%20video%20is%20created%20and%20not%20used.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20said%20this%20solution%20relies%20on%20you%20knowing%20a%20bit%20about%20PowerShell%2C%20being%20a%20Stream%20Admin%20and%20being%20happy%20to%20manually%20save%20some%20files%20(I%20couldn't%20figure%20out%20how%20to%20do%20pass%20through%20windows%20authentication%20for%20the%20script)%20so%20you%20have%20to%20manually%20save%20each%20paged%20JSON%20file%20of%20100%20videos.%3C%2FP%3E%3CP%3EIt%20took%20me%20about%2020minutes%20to%20export%20information%20about%20591%20videos%20(about%203%20hours%20to%20make%20the%20script).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20use%20the%20script%3C%2FP%3E%3CUL%3E%3CLI%3Eupdate%20each%20variable%20marked%20with%26nbsp%3B%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%3C%2FLI%3E%3CLI%3Ein%20a%20normal%20(not%20admin)%20powershell%20window%20run%20the%20script%20(i%20copy%20and%20paste%20logical%20parts%20into%20the%20powershell%20window)%3C%2FLI%3E%3CLI%3Eyou%20will%20be%20given%20several%20urls%2C%20to%20visit%20and%20save%20the%20JSON%20files%20from%3C%2FLI%3E%3CLI%3Eonce%20you%20have%20the%20JSON%20files%20the%20final%20part%20of%20the%20script%20reads%20those%2C%20and%20exports%20a%20CSV%20file%20with%20a%20row%20per%20video%20in%20STREAM%3C%2FLI%3E%3C%2FUL%3E%3CP%3ENOTE%20%3A%20as%20an%20admin%20you%20see%20all%20videos%2C%20so%20before%20you%20share%20the%20CSV%20with%20others%20be%20aware%20that%20there%20may%20be%20sensitive%20information%20in%20it%20that%20most%20users%20can't%20see%20due%20to%20STREAM's%20in%20built%20security.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20have%20much%20time%2C%20hence%20I%20made%20this%20script%20so%20please%20don't%20expect%20quick%20answers%20to%20any%20questions.%20This%20script%20is%20rough%2C%20use%20it%20if%20it%20helps%2C%20but%20...%20be%20professional%20and%20check%20it%20before%20you%20use%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23reference%20%20%20https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-stream-forum%2Fpowershell-script-to-audit-and-export-channel-content-details-of%2Fm-p%2F354832%0A%23%20goal%20of%20this%20script%20%0A%23-%20get%20list%20of%20all%20videos%20in%20stream%20for%20analysis%0A%23-%20it%20takes%20about%2020%20minutes%20to%20do%20this%20for%20500%20stream%20videos.%0A%0A%23First%20%0A%23%20find%20out%20what%20your%20api%20source%20is%0A%23%20go%20to%20the%20following%20URL%20in%20chrome%20as%20an%20admin%20of%20Stream%20https%3A%2F%2Fweb.microsoftstream.com%2Fbrowse%0A%23%20using%20Developer%20tools%20look%20at%20the%20%22console%22%20search%20for%20.api.microsoftstream%20to%20find%20out%20what%20is%20between%20https%3A%2F%2F%20%20and%20%20%20%20%20.api.microsoftstream%20in%20my%20case%20%20%20%20https%3A%2F%2Faase-1.api.microsoftstream.com%2Fapi%2F%0A%0A%5Bstring%5D%24rootAPIlocation%20%3D%20%22aase-1%22%20%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%20to%20the%20one%20you%20find%20in%20the%20console%20view%20%0A%0A%23enter%20where%20you%20on%20your%20computer%20you%20want%20the%20files%20to%20go%0A%5Bstring%5D%24PowerShellScriptFolder%20%3D%20%22C%3A%5Ctemp%5Cstream-analysis%22%20%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%0A%23json%20files%20will%20be%20saved%20into%20%22VideosJSON%22%20folder%20%0A%5Bstring%5D%24streamJSONfolder%20%3D%20Join-Path%20-Path%20%24PowerShellScriptFolder%20-ChildPath%20%22VideosJSON%22%20%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%20if%20you%20want%20a%20different%20folder%20name%0A%23remove%20all%20JSON%20items%20in%20this%20folder%0ARemove-Item%20-path%20%24streamJSONfolder%5C*%20-include%20*.json%20-Force%20-Recurse%0A%23guess%20approx%20number%20of%20videos%20you%20think%20you%20have%20divide%20by%20100%20e.g.%209%20%3D%20900%20videos%0A%5Bint%5D%24Loopnumber%20%3D%206%20%20%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%0A%0A%23put%20in%20your%20stream%20portal%20url%0A%5Bstring%5D%24StreamPortal%20%3D%20%22https%3A%2F%2Fweb.microsoftstream.com%2F%3FNoSignUpCheck%3D1%22%0A%23put%20in%20the%20url%20where%20you%20see%20all%20videos%20from%20in%20stream%0A%5Bstring%5D%24StreamPortalVideoRoot%20%3D%20%22https%3A%2F%2Fweb.microsoftstream.com%2Fbrowse%2F%22%20%23%24StreamPortalChannelRootForFindingVideos%0A%5Bstring%5D%24StreamPortalVideoViewRoot%3D%20%22https%3A%2F%2Fweb.microsoftstream.com%2Fvideo%2F%22%20%23%20for%20watching%20a%20video%0A%0A%23this%20builds%20from%20the%20info%20you've%20put%20in%20a%20URL%20which%20will%20give%20back%20the%20JSON%20info%20about%20all%20your%20videos.%0A%5Bstring%5D%24StreamAPIVideos100%20%3D%20%22https%3A%2F%2F%24rootAPIlocation.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%60%24top%3D100%26amp%3B%60%24orderby%3DpublishedDate%2520desc%26amp%3B%60%24expand%3Dcreator%2Cevents%26amp%3B%60%24filter%3Dpublished%2520and%2520(state%2520eq%2520%2527Completed%2527%2520or%2520contentSource%2520eq%2520%2527livestream%2527)%26amp%3Badminmode%3Dtrue%26amp%3Bapi-version%3D1.4-private%26amp%3B%60%24skip%3D0%22%20%23%24streamapichannels100%0A%0A%0A%0A%5Bint%5D%24skipCounter%0A%5Bint%5D%24skipCounterNext%20%3D%20%24skipCounter%2B100%0A%5Bstring%5D%24fileName%20%3D%20%22jsonfor-%24skipCounter-to-%24skipCounterNext.json%22%0A%0A%23next%20section%20creates%20the%20URLS%20you%20need%20to%20manually%20download%20the%20json%20from%20%2C%20it%20was%20too%20hard%20to%20figure%20out%20how%20to%20do%20this%20programatically%20with%20authentication.%0A%0A%0AWrite-Host%20%22%20%20%20%20%20%20Starting%20Chrome%20Enter%20your%20credentials%20to%20load%20O365%20Stream%20portal%22%20-ForegroundColor%20Magenta%0AStart-Process%20-FilePath%20'chrome.exe'%20-ArgumentList%20%24StreamPortal%0ARead-Host%20-Prompt%20%22Press%20Enter%20to%20continue%20....%22%0A%0AWrite-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0AWrite-host%20%22%20--Copy%20and%20past%20each%20url%20into%20chrome-----%22%20-ForegroundColor%20Green%0AWrite-host%20%22%20--save%20JSON%20output%20into%20%24streamJSONfolder%22%20-ForegroundColor%20Green%0A%0A%0Afor(%24i%3D0%3B%24i%20-lt%20%24Loopnumber%3B%20%24i%2B%2B)%20%7B%0A%20%24skipCounter%20%3D%20%24i*100%0A%20if(%24skipCounter%20-eq%200)%20%7B%0A%20%20write-host%20%24StreamAPIVideos100%0A%20%7D%20else%20%7B%0A%20%20%23write-host%20%24StreamAPIVideos100%0A%20%20%24StreamAPIVideos100.replace(%22skip%3D0%22%2C%22skip%3D%24skipCounter%22)%0A%20%7D%0A%20%0A%7D%0A%0A%0AWrite-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0ARead-Host%20-Prompt%20%22Press%20Enter%20to%20continue%20....%22%0A%0A%0A%0AWrite-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0A%24JSONFiles%20%3D%20Get-ChildItem%20-Path%20%24streamJSONfolder%20-Recurse%20-Include%20*.json%0A%5Bint%5D%24videoscounter%20%3D%200%0A%24VideosjsonAggregateddata%3D%40()%0A%24data%3D%40()%0A%0Aforeach(%24fileItem%20in%20%24JSONFiles)%0A%7B%0A%20Write-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0A%20Write-Host%20%22%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20getting%20content%20of%20JSON%20File%3A%22%2C%20%24fileItem%2C%20%22-%20Path%3A%22%2C%20%24fileItem.FullName%20-ForegroundColor%20Yellow%0A%20%24Videosjsondata%20%3D%20Get-Content%20-Raw%20-Path%20%24fileItem.FullName%20%7C%20ConvertFrom-Json%0A%20%24VideosjsonAggregateddata%20%2B%3D%20%24Videosjsondata%0A%20Write-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0A%20%23Write-Host%20%22%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Channel%20JSON%20Raw%20data%3A%22%2C%20%24Videosjsondata%20-ForegroundColor%20green%0A%20%23Read-Host%20-Prompt%20%22Press%20Enter%20to%20continue%20....%22%0A%7D%0A%0Aforeach(%24myVideo%20in%20%24VideosjsonAggregateddata.value)%0A%7B%0A%0A%20%20%24videoscounter%20%2B%3D%201%0A%20%20%24datum%20%3D%20New-Object%20-TypeName%20PSObject%0A%20%20Write-host%20%22%20%20%20%20%20%20%20%20-----------------------------------------%22%20-ForegroundColor%20Green%0A%20%20Write-Host%20%22%20%20%20%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Video%20(N%C2%B0%22%2C%20%24videoscounter%20%2C%22)%20ID%3A%22%2C%20%24myVideo.id%20-ForegroundColor%20green%0A%20%20Write-Host%20%22%20%20%20%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Video%20Name%3A%22%2C%20%24myVideo.name%2C%22%20created%3A%22%2C%20%24myVideo.created%2C%22-%20modified%3A%22%2C%20%24myVideo.modified%20-ForegroundColor%20green%0A%20%20Write-Host%20%22%20%20%20%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Video%20Metrics%20views%3A%22%2C%20%24myVideo.metrics.views%2C%20%22-%20comments%3A%22%2C%20%24myVideo.metrics.comments%20-ForegroundColor%20Magenta%0A%20%20Write-Host%20%22%20%20%20%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Video%20Creator%20Name%3A%20%22%2C%20%24myVideo.creator.name%20%2C%20%22%20-%20Email%3A%22%2C%20%24myVideo.creator.mail%20-ForegroundColor%20Magenta%20%20%0A%20%20Write-Host%20%22%20%20%20%20%20%20%20%20%3D%3D%3D%3D%3D%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20Video%20Description%3A%20%22%2C%20%24myVideo.description%20-ForegroundColor%20Magenta%20%0A%0A%0A%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoID%20-Value%20%24myVideo.id%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoName%20-Value%20%24myVideo.name%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoURL%20-Value%20%24(%24StreamPortalVideoViewRoot%20%2B%20%24myVideo.id)%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoCreatorName%20-Value%20%24myVideo.creator.name%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoCreatorEmail%20-Value%20%24myVideo.creator.mail%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoCreationDate%20-Value%20%24myVideo.created%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoModificationDate%20-Value%20%24myVideo.modified%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoViews%20-Value%20%24myVideo.metrics.views%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoComments%20-Value%20%24myVideo.metrics.comments%0A%20%20%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20Videodescription%20-Value%20%24myVideo.description%0A%0A%0A%20%20%24data%20%2B%3D%20%24datum%0A%20%0A%7D%0A%0A%24datestring%20%3D%20(get-date).ToString(%22yyyyMMdd-hhmm%22)%0A%24csvfileName%20%3D%20(%24PowerShellScriptFolder%20%2B%20%22%5CO365StreamVideoDetails_%22%20%2B%20%24datestring%20%2B%20%22.csv%22)%20%20%20%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%20if%20you%20want%20a%20different%20file%20name%20%0A%20%0AWrite-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%0AWrite-Host%20(%22%20%26gt%3B%26gt%3B%26gt%3B%20writing%20to%20file%20%7B0%7D%22%20-f%20%24csvfileName)%20-ForegroundColor%20Green%0A%24data%20%7C%20Export-csv%20%24csvfileName%20-NoTypeInformation%0AWrite-host%20%22%20-----------------------------------------%22%20-ForegroundColor%20Green%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDisclaimer%20%3A%26nbsp%3B%3CSPAN%3EYou%20can%20use%20that%20solution%20as%20you%20want%20and%20modify%20it%20depending%20of%20your%20case.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%20to%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41125%22%20target%3D%22_blank%22%3E%40Fabrice%20Romelard%3C%2FA%3E%26nbsp%3B%20and%26nbsp%3B%20his%26nbsp%3B%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-stream-forum%2Fpowershell-script-to-audit-and-export-channel-content-details-of%2Fm-p%2F354832%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-stream-forum%2Fpowershell-script-to-audit-and-export-channel-content-details-of%2Fm-p%2F354832%3C%2FA%3E%26nbsp%3Bwhich%20gave%20me%20enough%20to%20figure%20out%20how%20to%20do%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1752149%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAudit%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecsv%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20APIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EStream%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Evideos%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1869651%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1869651%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F228833%22%20target%3D%22_blank%22%3E%40Dorje%20McKinnon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20sharing%20the%20code%2C%20but%20to%20America%20what%20is%20the%20variable%3F%20I%20found%20the%20following%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EEurope%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fchannels%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Feuno-1.api.microsoftstream.com%3C%2FA%3E%3C%2FLI%3E%3CLI%3EAsia%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Faase-1.api.microsoftstream.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faase-1.api.microsoftstream.com%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1883092%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1883092%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F228833%22%20target%3D%22_blank%22%3E%40Dorje%20McKinnon%3C%2FA%3E%26nbsp%3BWow!%20This%20is%20a%20life%20saver!%20We%20are%20using%20it%20to%20clean%20up%20our%20Stream%20library.%20I%20can't%20believe%20more%20people%20haven't%20replied%20or%20%2B1%20Liked.%20I%20created%20an%20account%20specifically%20to%20reply%20here%20and%20say%20Thank%20You!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1925537%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1925537%22%20slang%3D%22en-US%22%3E%3CP%3EUS%20West%20Region%20is%3A%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWish%20I%20could%20get%20info%20on%20whether%20or%20not%20the%20video%20is%20shared%20and%20who%20it's%20shared%20with.%26nbsp%3B%20Including%20the%20Entire%20Company%20or%20not.%26nbsp%3B%20Thanks%20for%20your%20good%20work!%26nbsp%3B%20Also%2C%20there%20was%20no%20Make%20Directory%20commands%20setup%20for%20the%20folder%20structure.%26nbsp%3B%20I%20had%20to%20manually%20create%20these%3A%26nbsp%3Bstream-analysis%5CVideosJSON.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20just%20processed%2027%20pages%20worth.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1927733%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1927733%22%20slang%3D%22en-US%22%3E%3CP%3EHere%20are%20some%20additional%20updates.%26nbsp%3B%20Back%20in%20March%202020%2C%20when%20MS%20deployed%20the%20admin%20mode%20and%20admin%20page%20our%20default%20sharing%20changed%20so%20that%20every%20new%20recording%20had%20%22organization%22%20permissions%20on%20it.%26nbsp%3B%20This%20means%20anyone%20in%20the%20domain%20could%20watch%20any%20of%20our%20recorded%20meetings.%26nbsp%3B%20This%20was%20not%20good%2C%20hence%20why%20I%20am%20here.%26nbsp%3B%20I%20found%20out%20how%20to%20filter%20the%20output%20of%20this%20script%20to%20only%20include%20those%20made%20available%20to%20the%20whole%20org.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20StreamAPIVideos100%20string%2C%20add%20the%20following%20right%20before%20%26amp%3Badminmode%3C%2FP%3E%3CP%3E%2520and%2520privacymode%2520eq%2520%2527organization%2527%2520%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditionally%2C%20in%20the%20%24dataum%20string%20building%20area%20add%20the%20following%20line%3A%3C%2FP%3E%3CP%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20PrivacyMode%20-Value%20%24myVideo.privacymode%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20new%20line%20will%20add%20a%20column%20in%20the%20.csv%20file%20output%2C%20so%20if%20you%20want%20to%20not%20do%20the%20first%20edit%2C%20but%20simply%20list%20the%20privacy%20mode%20for%20each%20video%2C%20only%20add%20the%20datum%20code%20above.%26nbsp%3B%20I%20had%202600%2B%20videos%2C%20so%20for%20me%2C%20filtering%20by%20%22organization%22%20works%20much%20better%20as%20it%20get's%20rid%20of%20most%20of%20the%20extra%20unnecessary%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20entire%20string%20for%20the%20org%20filter%20in%20the%20first%20edit.%3C%2FP%3E%3CP%3E%5Bstring%5D%24StreamAPIVideos100%20%3D%20%22https%3A%2F%2F%24rootAPIlocation.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%60%24top%3D100%26amp%3B%60%24orderby%3DpublishedDate%2520desc%26amp%3B%60%24expand%3Dcreator%2Cevents%26amp%3B%60%24filter%3Dpublished%2520and%2520(state%2520eq%2520%2527Completed%2527%2520or%2520contentSource%2520eq%2520%2527livestream%2527)%2520and%2520privacymode%2520eq%2520%2527organization%2527%2520%26amp%3Badminmode%3Dtrue%26amp%3Bapi-version%3D1.4-private%26amp%3B%60%24skip%3D0%22%20%23%24streamapichannels100%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1928820%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1928820%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F867535%22%20target%3D%22_blank%22%3E%40mfarley%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280259%22%20target%3D%22_blank%22%3E%40Ryechz%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20glad%20you've%20found%20it%20useful.%3CBR%20%2F%3EThanks%20also%20for%20the%20updates%20and%20new%20code%2C%20it%20has%20been%20useful%20to%20me%20too.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029830%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029830%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F228833%22%20target%3D%22_blank%22%3E%40Dorje%20McKinnon%3C%2FA%3E%26nbsp%3B%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280259%22%20target%3D%22_blank%22%3E%40Ryechz%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%20-%20this%20was%20very%20helpful.%20I%20have%20also%20tweaked%20mine%20to%20include%20privacy%20information.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2116239%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2116239%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20of%20all%20HUGE%20THANK%20YOU%20for%20this%20script%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F228833%22%20target%3D%22_blank%22%3E%40Dorje%20McKinnon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERunning%20your%20code%20that%20generates%20the%26nbsp%3BURLs%2C%20I%20found%20we%20have%2010%2C400%2B%20videos%20in%20Stream.%20I%20knew%20we%20were%20over%201.3%20TB%20of%20space%2C%20but%20I%20couldn't%20find%20a%20way%20in%20the%20MS%20Stream%20Admin%20pages%20to%20understand%20the%20size%20and%20scope%20of%20the%20problem.%20We%20are%20a%20global%20company%20and%20with%20everyone%20in%20lock-down%20for%20a%20year%2C%20this%20got%20out%20of%20hand%20in%20a%20hurry.%3C%2FP%3E%3CP%3EI%20also%20wanted%20to%20share%20some%20of%20the%20additional%20'%24datum'%20I've%20added%20and%20found%20useful%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoDuration%20-Value%20%24myVideo.media.duration%3CBR%20%2F%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoHeight%20-Value%20%24myVideo.media.height%3CBR%20%2F%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoWidth%20-Value%20%24myVideo.media.width%3CBR%20%2F%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoIsAudioOnly%20-Value%20%24myVideo.media.isAudioOnly%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24datum%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20VideoContentType%20-Value%20%24myVideo.contentType%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethese%20return%20values%20like%20the%20following%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVideoDuration%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20VideoHeight%26nbsp%3B%20%26nbsp%3B%20VideoWidth%26nbsp%3B%20%26nbsp%3BVideoIsAudioOnly%3C%2FP%3E%3CTABLE%20width%3D%22524%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3EPT28M10.25S%3C%2FTD%3E%3CTD%3E360%3C%2FTD%3E%3CTD%3E640%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EPT1H55M13.6S%3C%2FTD%3E%3CTD%3E360%3C%2FTD%3E%3CTD%3E640%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EPT56M19.6S%3C%2FTD%3E%3CTD%3E360%3C%2FTD%3E%3CTD%3E640%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EPT28M14.144S%3C%2FTD%3E%3CTD%3E1080%3C%2FTD%3E%3CTD%3E1920%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EPT1H10M34.56S%3C%2FTD%3E%3CTD%3E1080%3C%2FTD%3E%3CTD%3E1920%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVideo%20Duration%20is%20going%20to%20be%20a%20bit%20tricky%20to%20parse%20out%20in%20Excel.%20And%20the%20VideoIsAudioOnly%20is%20returning%20FALSE%20on%20all%20videos%20so%20far%2C%20so%20I%20will%20leave%20that%20one%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20again%20GREAT%20code%20here%20Dorje%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3EJonathan%20Ogden%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2116623%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20list%20ALL%20videos%20in%20your%20365%20Stream%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2116623%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369997%22%20target%3D%22_blank%22%3E%40Jonathan_Ogden%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20glad%20this%20has%20helped%20you%20and%20your%20users%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20so%20much%20for%20the%20extra%20properties%20of%20the%20videos%2C%20I've%20just%20this%20week%20been%20asked%20if%20I%20can%20get%20out%20the%20length%20of%20the%20videos%2C%20so%20great%20timing!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDorje%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

I hope this is useful to everyone. 

My goal was to get a list of all videos in my stream so that I could contact each video creator about the changes that are coming to stream. Also so I could figure out how much work there was to do in moving, and how much video is created and not used.

 

That said this solution relies on you knowing a bit about PowerShell, being a Stream Admin and being happy to manually save some files (I couldn't figure out how to do pass through windows authentication for the script) so you have to manually save each paged JSON file of 100 videos.

It took me about 20minutes to export information about 591 videos (about 3 hours to make the script).

 

To use the script

  • update each variable marked with #<<<< Update this value
  • in a normal (not admin) powershell window run the script (i copy and paste logical parts into the powershell window)
  • you will be given several urls, to visit and save the JSON files from
  • once you have the JSON files the final part of the script reads those, and exports a CSV file with a row per video in STREAM

NOTE : as an admin you see all videos, so before you share the CSV with others be aware that there may be sensitive information in it that most users can't see due to STREAM's in built security.

 

I don't have much time, hence I made this script so please don't expect quick answers to any questions. This script is rough, use it if it helps, but ... be professional and check it before you use it.

 

#reference   https://techcommunity.microsoft.com/t5/microsoft-stream-forum/powershell-script-to-audit-and-export-channel-content-details-of/m-p/354832
# goal of this script 
#- get list of all videos in stream for analysis
#- it takes about 20 minutes to do this for 500 stream videos.

#First 
# find out what your api source is
# go to the following URL in chrome as an admin of Stream https://web.microsoftstream.com/browse
# using Developer tools look at the "console" search for .api.microsoftstream to find out what is between https://  and     .api.microsoftstream in my case    https://aase-1.api.microsoftstream.com/api/

[string]$rootAPIlocation = "aase-1"  #<<<< Update this value to the one you find in the console view 

#enter where you on your computer you want the files to go
[string]$PowerShellScriptFolder = "C:\temp\stream-analysis"  #<<<< Update this value
#json files will be saved into "VideosJSON" folder 
[string]$streamJSONfolder = Join-Path -Path $PowerShellScriptFolder -ChildPath "VideosJSON"  #<<<< Update this value if you want a different folder name
#remove all JSON items in this folder
Remove-Item -path $streamJSONfolder\* -include *.json -Force -Recurse
#guess approx number of videos you think you have divide by 100 e.g. 9 = 900 videos
[int]$Loopnumber = 6   #<<<< Update this value

#put in your stream portal url
[string]$StreamPortal = "https://web.microsoftstream.com/?NoSignUpCheck=1"
#put in the url where you see all videos from in stream
[string]$StreamPortalVideoRoot = "https://web.microsoftstream.com/browse/" #$StreamPortalChannelRootForFindingVideos
[string]$StreamPortalVideoViewRoot= "https://web.microsoftstream.com/video/" # for watching a video

#this builds from the info you've put in a URL which will give back the JSON info about all your videos.
[string]$StreamAPIVideos100 = "https://$rootAPIlocation.api.microsoftstream.com/api/videos?NoSignUpCheck=1&`$top=100&`$orderby=publishedDate%20desc&`$expand=creator,events&`$filter=published%20and%20(state%20eq%20%27Completed%27%20or%20contentSource%20eq%20%27livestream%27)&adminmode=true&api-version=1.4-private&`$skip=0" #$streamapichannels100



[int]$skipCounter
[int]$skipCounterNext = $skipCounter+100
[string]$fileName = "jsonfor-$skipCounter-to-$skipCounterNext.json"

#next section creates the URLS you need to manually download the json from , it was too hard to figure out how to do this programatically with authentication.


Write-Host "      Starting Chrome Enter your credentials to load O365 Stream portal" -ForegroundColor Magenta
Start-Process -FilePath 'chrome.exe' -ArgumentList $StreamPortal
Read-Host -Prompt "Press Enter to continue ...."

Write-host " -----------------------------------------" -ForegroundColor Green
Write-host " --Copy and past each url into chrome-----" -ForegroundColor Green
Write-host " --save JSON output into $streamJSONfolder" -ForegroundColor Green


for($i=0;$i -lt $Loopnumber; $i++) {
	$skipCounter = $i*100
	if($skipCounter -eq 0) {
		write-host $StreamAPIVideos100
	} else {
		#write-host $StreamAPIVideos100
		$StreamAPIVideos100.replace("skip=0","skip=$skipCounter")
	}
	
}


Write-host " -----------------------------------------" -ForegroundColor Green
Read-Host -Prompt "Press Enter to continue ...."



Write-host " -----------------------------------------" -ForegroundColor Green
$JSONFiles = Get-ChildItem -Path $streamJSONfolder -Recurse -Include *.json
[int]$videoscounter = 0
$VideosjsonAggregateddata=@()
$data=@()

foreach($fileItem in $JSONFiles)
{
	Write-host " -----------------------------------------" -ForegroundColor Green
	Write-Host "     =====>>>> getting content of JSON File:", $fileItem, "- Path:", $fileItem.FullName -ForegroundColor Yellow
	$Videosjsondata = Get-Content -Raw -Path $fileItem.FullName | ConvertFrom-Json
	$VideosjsonAggregateddata += $Videosjsondata
	Write-host " -----------------------------------------" -ForegroundColor Green
	#Write-Host "     =====>>>> Channel JSON Raw data:", $Videosjsondata -ForegroundColor green
	#Read-Host -Prompt "Press Enter to continue ...."
}

foreach($myVideo in $VideosjsonAggregateddata.value)
{

		$videoscounter += 1
		$datum = New-Object -TypeName PSObject
		Write-host "        -----------------------------------------" -ForegroundColor Green
		Write-Host "        =====>>>> Video (N°", $videoscounter ,") ID:", $myVideo.id -ForegroundColor green
		Write-Host "        =====>>>> Video Name:", $myVideo.name," created:", $myVideo.created,"- modified:", $myVideo.modified -ForegroundColor green
		Write-Host "        =====>>>> Video Metrics views:", $myVideo.metrics.views, "- comments:", $myVideo.metrics.comments -ForegroundColor Magenta
		Write-Host "        =====>>>> Video Creator Name: ", $myVideo.creator.name , " - Email:", $myVideo.creator.mail -ForegroundColor Magenta		
		Write-Host "        =====>>>> Video Description: ", $myVideo.description -ForegroundColor Magenta	



		$datum | Add-Member -MemberType NoteProperty -Name VideoID -Value $myVideo.id
		$datum | Add-Member -MemberType NoteProperty -Name VideoName -Value $myVideo.name
		$datum | Add-Member -MemberType NoteProperty -Name VideoURL -Value $($StreamPortalVideoViewRoot + $myVideo.id)
		$datum | Add-Member -MemberType NoteProperty -Name VideoCreatorName -Value $myVideo.creator.name
		$datum | Add-Member -MemberType NoteProperty -Name VideoCreatorEmail -Value $myVideo.creator.mail
		$datum | Add-Member -MemberType NoteProperty -Name VideoCreationDate -Value $myVideo.created
		$datum | Add-Member -MemberType NoteProperty -Name VideoModificationDate -Value $myVideo.modified
		$datum | Add-Member -MemberType NoteProperty -Name VideoViews -Value $myVideo.metrics.views
		$datum | Add-Member -MemberType NoteProperty -Name VideoComments -Value $myVideo.metrics.comments
		$datum | Add-Member -MemberType NoteProperty -Name Videodescription -Value $myVideo.description


		$data += $datum
	
}

$datestring = (get-date).ToString("yyyyMMdd-hhmm")
$csvfileName = ($PowerShellScriptFolder + "\O365StreamVideoDetails_" + $datestring + ".csv")    #<<<< Update this value if you want a different file name 
	
Write-host " -----------------------------------------" -ForegroundColor Green
Write-Host (" >>> writing to file {0}" -f $csvfileName) -ForegroundColor Green
$data | Export-csv $csvfileName -NoTypeInformation
Write-host " -----------------------------------------" -ForegroundColor Green

 

 

 

 

 

 

Disclaimer : You can use that solution as you want and modify it depending of your case.

 

Many thanks to 

@Fabrice Romelard  and  his 
https://techcommunity.microsoft.com/t5/microsoft-stream-forum/powershell-script-to-audit-and-export-... which gave me enough to figure out how to do this.

 

10 Replies

Hi @Dorje McKinnon 

 

Thank you for sharing the code, but to America what is the variable? I found the following 

@Dorje McKinnon Wow! This is a life saver! We are using it to clean up our Stream library. I can't believe more people haven't replied or +1 Liked. I created an account specifically to reply here and say Thank You!

US West Region is:  https://uswe-1.api.microsoftstream.com/api/

 

Wish I could get info on whether or not the video is shared and who it's shared with.  Including the Entire Company or not.  Thanks for your good work!  Also, there was no Make Directory commands setup for the folder structure.  I had to manually create these: stream-analysis\VideosJSON.

 

I just processed 27 pages worth.

Here are some additional updates.  Back in March 2020, when MS deployed the admin mode and admin page our default sharing changed so that every new recording had "organization" permissions on it.  This means anyone in the domain could watch any of our recorded meetings.  This was not good, hence why I am here.  I found out how to filter the output of this script to only include those made available to the whole org.

 

In the StreamAPIVideos100 string, add the following right before &adminmode

%20and%20privacymode%20eq%20%27organization%27%20

 

Additionally, in the $dataum string building area add the following line:

$datum | Add-Member -MemberType NoteProperty -Name PrivacyMode -Value $myVideo.privacymode

 

This new line will add a column in the .csv file output, so if you want to not do the first edit, but simply list the privacy mode for each video, only add the datum code above.  I had 2600+ videos, so for me, filtering by "organization" works much better as it get's rid of most of the extra unnecessary work.

 

Here is the entire string for the org filter in the first edit.

[string]$StreamAPIVideos100 = "https://$rootAPIlocation.api.microsoftstream.com/api/videos?NoSignUpCheck=1&`$top=100&`$orderby=publishedDate%20desc&`$expand=creator,events&`$filter=published%20and%20(state%20eq%20%27Completed%27%20or%20contentSource%20eq%20%27livestream%27)%20and%20privacymode%20eq%20%27organization%27%20&adminmode=true&api-version=1.4-private&`$skip=0" #$streamapichannels100

@mfarley and @Ryechz 

I'm glad you've found it useful.
Thanks also for the updates and new code, it has been useful to me too.

@Dorje McKinnon , @Ryechz 

Many thanks - this was very helpful. I have also tweaked mine to include privacy information.

First of all HUGE THANK YOU for this script @Dorje McKinnon 

 

Running your code that generates the URLs, I found we have 10,400+ videos in Stream. I knew we were over 1.3 TB of space, but I couldn't find a way in the MS Stream Admin pages to understand the size and scope of the problem. We are a global company and with everyone in lock-down for a year, this got out of hand in a hurry.

I also wanted to share some of the additional '$datum' I've added and found useful

 

$datum | Add-Member -MemberType NoteProperty -Name VideoDuration -Value $myVideo.media.duration
$datum | Add-Member -MemberType NoteProperty -Name VideoHeight -Value $myVideo.media.height
$datum | Add-Member -MemberType NoteProperty -Name VideoWidth -Value $myVideo.media.width
$datum | Add-Member -MemberType NoteProperty -Name VideoIsAudioOnly -Value $myVideo.media.isAudioOnly

 

$datum | Add-Member -MemberType NoteProperty -Name VideoContentType -Value $myVideo.contentType

 

these return values like the following

 

VideoDuration                              VideoHeight    VideoWidth   VideoIsAudioOnly

PT28M10.25S360640FALSE
PT1H55M13.6S360640FALSE
PT56M19.6S360640FALSE
PT28M14.144S10801920FALSE
PT1H10M34.56S10801920FALSE

 

Video Duration is going to be a bit tricky to parse out in Excel. And the VideoIsAudioOnly is returning FALSE on all videos so far, so I will leave that one out.

 

But again GREAT code here Dorje

 

Thank you,

Jonathan Ogden

@Jonathan_Ogden 

 

I'm glad this has helped you and your users out.

 

Thanks so much for the extra properties of the videos, I've just this week been asked if I can get out the length of the videos, so great timing!

 

Dorje

 

@Dorje McKinnonThanks for your efforts to build the script and make our lives easier. However, when I rum the URL (After changing the values) I'm getting a blank excel file.

Can someone help me out here?

@abrarali 

Here is the URL I use for Western US. different regions have different datacenters, so you need to update the first part of the URL, the uswe-1

 

https://uswe-1.api.microsoftstream.com/api/videos?NoSignUpCheck=1&$top=100&$orderby=publishedDate%20...

 

Sorry for the mess, I just wanted to remove any ID's and user info.

Here is the output from the browser.

I had to copy and paste this into a txt file, then change the .txt to .json

Capture.PNG