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%3CLINGO-SUB%20id%3D%22lingo-sub-2159049%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-2159049%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%3EThanks%20for%20your%20efforts%20to%20build%20the%20script%20and%20make%20our%20lives%20easier.%20However%2C%20when%20I%20rum%20the%20URL%20(After%20changing%20the%20values)%20I'm%20getting%20a%20blank%20excel%20file.%3C%2FP%3E%3CP%3ECan%20someone%20help%20me%20out%20here%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2159339%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-2159339%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F975863%22%20target%3D%22_blank%22%3E%40abrarali%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20URL%20I%20use%20for%20Western%20US.%20different%20regions%20have%20different%20datacenters%2C%20so%20you%20need%20to%20update%20the%20first%20part%20of%20the%20URL%2C%20the%20%3CEM%3Euswe-1%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100%26amp%3B%24orderby%3DpublishedDate%2520desc%26amp%3B%24expand%3Dcreator%2Cevents%26amp%3B%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%24skip%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100%26amp%3B%24orderby%3DpublishedDate%2520desc%26amp%3B%24expand%3Dcreator%2Cevents%26amp%3B%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%24skip%3D0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20for%20the%20mess%2C%20I%20just%20wanted%20to%20remove%20any%20ID's%20and%20user%20info.%3C%2FP%3E%3CP%3EHere%20is%20the%20output%20from%20the%20browser.%3C%2FP%3E%3CP%3EI%20had%20to%20copy%20and%20paste%20this%20into%20a%20txt%20file%2C%20then%20change%20the%20.txt%20to%20.json%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20836px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F257039i2D70767C6CAA9D28%2Fimage-dimensions%2F836x388%3Fv%3Dv2%22%20width%3D%22836%22%20height%3D%22388%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2188511%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-2188511%22%20slang%3D%22en-US%22%3EGreat%20script%2C%20exactly%20what%20I%20needed.%20I%20wanted%20to%20get%20all%20the%20public%20video's%20that%20everyone%20in%20the%20org%20could%20see%2C%20so%20I%20changed%20below%2C%20and%20logged%20in%20as%20a%20standard%20user.%3CBR%20%2F%3E-----------------------%3CBR%20%2F%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%3Bapi-version%3D1.4-private%26amp%3B%60%24skip%3D0%22%20%23%24streamapichannels100%3CBR%20%2F%3E------------------------------------%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190708%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-2190708%22%20slang%3D%22en-US%22%3Ethanks%20for%20answering%20%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%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2255721%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-2255721%22%20slang%3D%22en-US%22%3EI%20tried%20running%20the%20script%20but%20is%20not%20providing%20me%20any%20list.%20It's%20just%20creating%20a%20blank%20cache%20csv%20file.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2304725%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-2304725%22%20slang%3D%22en-US%22%3E%3CP%3EAppreciate%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%3Bidea%2C%26nbsp%3BI%20also%20created%20a%20windows%20form%20application%20which%20will%20automatically%20enumerate%20that%20API%20and%20save%20the%20result%20to%20a%20CSV%20file.%20Please%20reference%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffrankchen76%2FStreamsInventory%2Fblob%2Fmaster%2Fdemo.gif%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Efrankchen76%20%2F%20StreamsInventory%3C%2FA%3E%26nbsp%3BGitHub%20repository%20for%20the%20code.%20I%20also%20created%20a%20blog%20post%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ffrankchen2016.medium.com%2Finventory-videos-from-classic-stream-355bee0aac3%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EInventory%20videos%20from%20Classic%20Stream%3C%2FA%3E%26nbsp%3Bto%20explain%20the%20detail%20steps.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2492474%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-2492474%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20so%20much%20for%20this%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.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%20I%20am%20not%20able%20to%20get%20the%20json%20content.%20When%20I%20paste%20them%20in%20Chroome%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fhttps%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2F.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100....%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fhttps%3A%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2F.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100....%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EI%20get%20an%20issue%20saying%20the%20query%20is%20invalid.%20I%20have%20tried%20withouth%20the%20double%20https%2F%2F%20but%20same%20issue.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAppreaciate%20your%20help!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2493201%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-2493201%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%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%2C%20did%20you%20find%20a%20way%20to%20get%20the%20size%20of%20the%20videos%3F%20I%20only%20get%20Width%20and%20Height%20but%20that%20is%20not%20helpful%20at%20all%20for%20the%20size.%3C%2FP%3E%0A%3CP%3EThanks%20a%20lot!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2499024%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-2499024%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F518033%22%20target%3D%22_blank%22%3E%40rrivero11%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20you've%20set%20the%26nbsp%3B%3C%2FP%3E%3CPRE%3E%24rootAPIlocation%3C%2FPRE%3E%3CP%3Eto%26nbsp%3Bhttps%2F%2Fuswe-1.api.microsoftstream.com%2Fapi%2F%3C%2FP%3E%3CP%3Eso%20that%20when%20the%20code%20creates%26nbsp%3B%3C%2FP%3E%3CPRE%3E%24StreamAPIVideos100%3C%2FPRE%3E%3CP%3Eit%20is%20wrong%3CBR%20%2F%3Eyou%20should%20set%20as%20follows%3A%26nbsp%3B%20%24rootAPIlocation%20%3D%20%22uswe-1%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2499046%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-2499046%22%20slang%3D%22en-US%22%3EYes!%20Manage%20to%20solve%20that%20one!%20Thanks.%20Just%20wondering%20if%20finally%20you%20were%20able%20to%20obtain%20the%20size%20of%20each%20video%2C%20as%20that%20was%20the%20one%20I%20am%20looking%20for%20%3A)%3C%2Fimg%3E%20Awesome%20solution%20btw!%20Great%20job%20and%20thanks%20for%20sharing%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2521281%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-2521281%22%20slang%3D%22en-US%22%3EHi.%20This%20is%20%22almost%22%20working%20perfectly.%20Once%20I%20got%20the%20Data%20Centre%20and%20realised%20the%20URLs%20in%20PowerShell%20were%20generated%20to%20use%20to%20paste%20into%20a%20browser%2C%20then%20copy%20and%20paste%20to%20a%20text%20file%20with%20a%20.son%20extension%20inside%20a%20directory%20I%20had%20to%20create%20called%20VideosJSON%20I%20was%20away.%3CBR%20%2F%3E%3CBR%20%2F%3EHowever...%20When%20I%20run%20the%20code%20from%20this%20blog%20(%3CA%20href%3D%22https%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%26amp%3B%24top%3D100%3C%2FA%3E%20...%20etc)%20%2C%20I%20get%20one%20page%20of%20JSON%2C%20but%20when%20I%20use%20a%20similar%20solution%20link%20here%3A%20%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%20that%20calls%20Channels%20(%3CA%20href%3D%22https%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fchannels%3F%24top%3D100%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fchannels%3F%24top%3D100%3C%2FA%3E...%20etc%20)%20I%20get%20two%20pages%20of%20JSON%20and%20more%20videos%20listed.%20But%20that%20code%20doesn't%20give%20me%20the%20duration%20and%20video.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20realised%20that%20Ryechz%20down%20below%20said%20to%20add%20this%3A%20%2520and%2520privacymode%2520eq%2520%2527organization%2527%2520%20before%20%26amp%3Badminmode%3CBR%20%2F%3E%3CBR%20%2F%3EOnce%20I%20removed%20that%2C%20I%20then%20got%20all%20the%20videos.%3CBR%20%2F%3E%3CBR%20%2F%3EStill%20no%20size%20%3A(%3C%2Fimg%3E%20But%20I%20think%20I%20might%20be%20able%20to%20fudge%20that%20based%20on%20duration%20and%20height%2Fwidth%20to%20at%20least%20get%20a%20rough%20idea.%20720p%20HD%20is%20about%205%20MB%20per%20minute%3CBR%20%2F%3E%3CBR%20%2F%3EOne%20trap%20for%20noobies%20is%20that%20in%20the%20scripit%20it%20first%20goes%20and%20purges%20and%20json%20files%20in%20the%20target%20directory.%20So%20if%20you%20have%20run%20this%20once%20to%20generate%20them%2C%20and%20realised%20you%20didn't%20have%20enough%20URLs%2C%20and%20run%20it%20a%20second%20time...%20so%20a%20bit%20of%20defensive%20code%20to%20compress-archive%20and%20move%20might%20be%20better%20%3A)%3C%2Fimg%3E%3CBR%20%2F%3E%3CBR%20%2F%3EOh%20also%2C%20I%20guess%20you%20could%20probably%20add%20Start-Process%20-FilePath%20'chrome.exe'%20-ArgumentList%20'%3CA%20href%3D%22https%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Feuno-1.api.microsoftstream.com%2Fapi%2Fvideos%3FNoSignUpCheck%3D1%3C%2FA%3E......%20etc'%20to%20where%20you%20generate%20the%20URLs%20to%20save%20some%20time.%3CBR%20%2F%3E%3CBR%20%2F%3ECool%20piece%20of%20work%20though!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2521293%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-2521293%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F53516%22%20target%3D%22_blank%22%3E%40Conrad%20Murray%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efor%20the%20updates%20and%20comments%2C%20I'm%20sure%20they'll%20help%20everyone%20out.%3C%2FP%3E%3CP%3EWhen%20I%20have%20to%20come%20back%20to%20this%20code%20for%20work%20-%20next%20few%20weeks%20I'll%20incorporate%20what%20you've%20provided%20and%20update%20the%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDorje%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2556192%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-2556192%22%20slang%3D%22en-US%22%3E%3CP%3EDon't%20suppose%20you%20could%20record%20a%20video%20of%20setting%20it%20up%20and%20running%20it%3F%20I%20tried%20to%20get%20it%20working%20but%20failed%20somewhere%20and%20wasn't%20sure%20from%20the%20instructions%20what%20to%20expect%20so%20I%20parked%20it%20for%20a%20later%20date.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eedit%3A%20got%20it%20working%20thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2610088%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-2610088%22%20slang%3D%22en-US%22%3EThank%20you%20very%20much%20Dorje%20for%20sharing%20this%20script%20with%20the%20community!!%20What%20a%20wonderful%20tool.%3CBR%20%2F%3E%3CBR%20%2F%3EHas%20anyone%20had%20success%20with%20pulling%20the%20lastViewDate%3F%20All%20of%20my%20videos%20show%20%22null%22%20in%20the%20raw%20JSON%20data.%20This%20value%20would%20be%20very%20valuable%20for%20helping%20to%20determine%20when%20a%20video%20was%20last%20viewed.%3CBR%20%2F%3E%3CBR%20%2F%3EScott%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2613454%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-2613454%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1120297%22%20target%3D%22_blank%22%3E%40scottcampany%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStream%20doesn't%20seem%20to%20hold%20this%20data.%20The%20json%20that%20comes%20back%20contains%20some%20information%20userData.lastViewDate%26nbsp%3B%20BUT%20this%20is%20for%20the%20currently%20viewing%20user%20.%20In%20the%20case%20of%20this%20code%20it%20would%20be%20the%20last%20time%20this%20user%20viewed%20this%20video.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20far%20as%20I%20know%20this%20information%20isn't%20held%20anywhere%20other%20than%20perhaps%20in%20your%20network%20log%20files%20on%20a%20router%20somewhere.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20once%20the%20videos%20have%20moved%20to%20SharePoint%20%2F%20OneDrive%20then%20the%20GraphAPI%20does%20have%20information%20about%20Viewers%20and%20Views%20for%20each%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2613486%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-2613486%22%20slang%3D%22en-US%22%3EJust%20in%20case%20you're%20following%20this%20thread%20%3A%20I've%20updated%20it%20to%20include%20code%20suggestions%20from%20the%20folks%20who've%20commented%20on%20it.%20Many%20thanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2613504%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-2613504%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F975863%22%20target%3D%22_blank%22%3E%40abrarali%3C%2FA%3E%26nbsp%3B%2C%20try%20running%20the%20new%20code.%3C%2FP%3E%3CP%3EIt%20will%20auto%20open%20the%20JSON%20browser%20tabs%2C%20which%20you%20need%20to%20then%20manually%20save%20(ctrl%20%2B%20s)%20as%20JSON%20files%20into%20the%20folder%20you%20define%20in%20the%20script.%3C%2FP%3E%3CP%3EOnce%20those%20files%20exist%2C%20then%20your%20CSV%20file%20will%20contain%20something.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2613506%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-2613506%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1017790%22%20target%3D%22_blank%22%3E%40WhatTheFork%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20guess%20is%20that%20you%20didn't%20manually%20save%20the%20JSON%20files%20into%20the%20folder%20defined%20in%20the%20script.%3C%2FP%3E%3CP%3EThis%20new%20code%20will%20make%20it%20a%20bit%20easier%20(JSON%20files%20auto%20open%20in%20their%20own%20browser%20tabs)%2C%20BUT%20you%20still%20have%20to%20save%20each%20one%20as%20a%20JSON%20file%20into%20the%20folder%20you%20define%20in%20the%20script.%20Then%20your%20CSV%20won't%20be%20blank.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2613507%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-2613507%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F518033%22%20target%3D%22_blank%22%3E%40rrivero11%3C%2FA%3E%26nbsp%3B%2C%20take%20a%20look%20at%20the%20udpated%20code.%20I've%20put%20in%20the%20variables%20for%20USNO-1%20so%20it%20may%20help%20you%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2615168%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-2615168%22%20slang%3D%22en-US%22%3EI%20made%20a%20slight%20change%20to%20check%20for%20the%20%22C%3A%5CTemp%5Cstreamanalysis%22%20folder%20and%20if%20it%20does%20not%20exist%20then%20create%20it.%20This%20may%20be%20helpful%20for%20those%20who%20need%20to%20run%20the%20script%20more%20than%20once.%3CBR%20%2F%3E%3CBR%20%2F%3E%23enter%20where%20you%20on%20your%20computer%20you%20want%20the%20files%20to%20go%3CBR%20%2F%3E%5Bstring%5D%24PowerShellScriptFolder%20%3D%20%22C%3A%5CTemp%5Cstreamanalysis%22%20%23%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20Update%20this%20value%3CBR%20%2F%3Eif%20(-not(Test-Path%20C%3A%5CTemp%5Cstreamanalysis))%20%7B%3CBR%20%2F%3ENew-Item%20-Path%20%24PowerShellScriptFolder%20-Force%20-ItemType%20Directory%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%23json%20files%20will%20be%20saved%20into%20%22VideosJSON%22%20folder%3CBR%20%2F%3E%5Bstring%5D%24streamJSONfolder%20%3D%20Join-Path%20-Path%20%24PowerShellScriptFolder%20-ChildPath%20%22VideosJSON%22%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%2C%3CBR%20%2F%3EScott%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2632582%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-2632582%22%20slang%3D%22en-US%22%3EHas%20anyone%20found%20an%20easier%20way%20to%20download%20the%20JSON%20files%3F%20We%20have%20over%2030%2C000%20videos%20so%20trying%20to%20find%20anyway%20to%20not%20have%20to%20download%20300%20tabs%20manually.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2633819%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-2633819%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359502%22%20target%3D%22_blank%22%3E%40swhitestrath%3C%2FA%3E%26nbsp%3B%2C%20I%20did%20try%20with%20the%20most%20recent%20version%20of%20my%20code%2C%20but%20I%20found%20keeping%20the%20security%20context%20of%20the%20browser%20window%20inside%20the%20code%20was%20the%20issue.%3C%2FP%3E%3CP%3EI'm%20sure%20someone%20who%20is%20better%20at%20that%20could%20send%20an%20HTTP%20request%20asking%20for%20the%20JSON%20files%2C%20then%20save%20them%20out%20as%20individual%20files%2C%20or%20combine%20them%20into%20one%20file.%20The%20issue%20I%20had%20was%20getting%20the%20code%20to%20run%20and%20ask%20for%20the%20files%20as%20the%20user%20account%20that%20has%20admin%20rights%20to%20the%20STREAM%20back%20end.%3C%2FP%3E%3CP%3EAll%20I've%20been%20able%20to%20find%20on%20API%20access%20is%20the%20following%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-stream-forum%2Flink-to-microsoft-stream-api-documentation%2Fm-p%2F188956%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-stream-forum%2Flink-to-microsoft-stream-api-documentation%2Fm-p%2F188956%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhich%20leads%20here%20(lots%20of%20the%20other%20links%20don't%20work)%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fstream%2Fstreamnew%2Fnew-stream%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fstream%2Fstreamnew%2Fnew-stream%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhich%20mentions%20the%20Graph%20API%3C%2FP%3E%3CP%3EBut%20this%20is%20all%20talking%20about%20New%20Stream%20(after%20the%20files%20are%20moved%20to%20SharePoint)%20AND%20my%20situation%20(and%20yours%20too%20I%20think%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359502%22%20target%3D%22_blank%22%3E%40swhitestrath%3C%2FA%3E%26nbsp%3Bis%20old%20Stream).%3CBR%20%2F%3ESorry%20I%20don't%20have%20a%20better%20option%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2633850%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-2633850%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20reply%20I%20think%20I%20was%20just%20trying%20my%20luck.%20I%20remember%20looking%20for%20the%20API%20awhile%20ago%20but%20I%20think%20it%20was%20very%20limited.%20There%20is%20probably%20a%20better%20way%20but%20don't%20really%20want%20to%20commit%20too%20much%20time%20to%20it%2C%20especially%20with%20the%20new%20stream%20coming%20along.%20I%20did%20try%20a%20few%20things%20myself%20using%20some%20chrome%20extensions%20but%20ran%20into%20authentication%20errors.%20Will%20just%20need%20to%20go%20with%20the%20manual%20option.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2978459%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-2978459%22%20slang%3D%22en-US%22%3EThanks%20Dorje%20for%20this%20amazing%20script.%20This%20is%20going%20to%20help%20tremendously%20as%20we%20are%20migrating%20tenants.%3CBR%20%2F%3E%3CBR%20%2F%3EHas%20anyone%20found%20a%20way%20to%20mass%20download%20the%20videos%3F%20We%20have%20folks%20that%20have%20left%20the%20company%20with%20lots%20of%20videos%20but%20doing%20them%201%20by%20one%20would%20be%20painful.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2991445%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-2991445%22%20slang%3D%22en-US%22%3Esuper%20script...%20shame%20the%20save%20tab%20to%20csv%20can't%20be%20automated%20as%20I%20seem%20to%20have%20well%20over%202000%20videos...%20saving%2020%2B%20tabs%20is%20a%20manual%20pain...%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2994471%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-2994471%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1162971%22%20target%3D%22_blank%22%3E%40Rolzzzz%3C%2FA%3E%26nbsp%3Bagreed%20it%20is%20a%20pain.%20If%20you've%20got%20some%20coding%20friends%20see%20if%20they've%20got%20a%20solution.%20It%20is%20well%20above%20what%20I%20was%20able%20to%20figure%20out%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular 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.

 

##>> Update 5 Aug 2021 <<##

Thanks to everyone who has commented, I've updated the code below with your suggestions

You still have to manually save the JSON browser tabs that show up as JSON files into a folder, but other than that I hope it is now easier for you to use :)

 

#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 
#[string]$rootAPIlocation = "uswe-1" 	# use this for Western US
#[string]$rootAPIlocation = "euno-1" 	# use this for the Europe North region

#enter where you on your computer you want the files to go
[string]$PowerShellScriptFolder = "C:\Temp\streamanalysis"  #<<<< 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

#>>> REMOVES all exiisting JSON files <<<<
#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 = 9   #<<<< 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" #$StreamAPIVideos100

# use the following if you want to only see files that have privacymode eq 'organization' i.e. video is visible to EVERYONE in the organisation
#Thanks to Ryechz for this 
#
#   [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"




[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
#Thanks Conrad Murray for this tip 
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
		Start-Process -FilePath 'chrome.exe' -ArgumentList $StreamAPIVideos100
	} else {
		write-host $StreamAPIVideos100.replace("skip=0","skip=$skipCounter")
		#following code opens browser tabs for each of the jsonfiles 
		#Thanks Conrad Murray for this tip 
		Start-Process -FilePath 'chrome.exe' -ArgumentList $StreamAPIVideos100.replace("skip=0","skip=$skipCounter")
				
	}
	
}

Write-host " --save each browser window showing JSON output into $streamJSONfolder" -ForegroundColor Green
Write-host " -----------------------------------------------------------------------------------" -ForegroundColor Green


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 ...."
}

	write-host "You have "  $VideosjsonAggregateddata.value.count " videos in Stream , using these selection criteria"

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 VideoLikes -Value $myVideo.metrics.likes
		$datum | Add-Member -MemberType NoteProperty -Name VideoViews -Value $myVideo.metrics.views
		$datum | Add-Member -MemberType NoteProperty -Name VideoComments -Value $myVideo.metrics.comments
		#the userData value is for the user running the JSON query i.e. did that user view this video. It isn't for information about all users who may have seen this video. There seems to be no information about that other than, total views = metrics.views 
		#$datum | Add-Member -MemberType NoteProperty -Name VideoComments -Value $myVideo.userData.isViewed
		$datum | Add-Member -MemberType NoteProperty -Name Videodescription -Value $myVideo.description
		
		#thanks Johnathan Ogden for these values 
		$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


		$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 " ------------------ DONE -----------------------" -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.

 

40 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

 

Great script, exactly what I needed. I wanted to get all the public video's that everyone in the org could see, so I changed below, and logged in as a standard user.
-----------------------
[string]$StreamAPIVideos100 = "https://$rootAPIlocation.api.microsoftstream.com/api/videos?NoSignUpCheck=1&`$top=100&`$orderby=publishedDate%20desc&`$expand=creator,events&api-version=1.4-private&`$skip=0" #$streamapichannels100
------------------------------------
I tried running the script but is not providing me any list. It's just creating a blank cache csv file.

Appreciate @Dorje McKinnon idea, I also created a windows form application which will automatically enumerate that API and save the result to a CSV file. Please reference to frankchen76 / StreamsInventory GitHub repository for the code. I also created a blog post Inventory videos from Classic Stream to explain the detail steps. Thanks

Thank you so much for this @Dorje McKinnon.

 

However I am not able to get the json content. When I paste them in Chroome:

https://https://uswe-1.api.microsoftstream.com/api/.api.microsoftstream.com/api/videos?NoSignUpCheck....

I get an issue saying the query is invalid. I have tried withouth the double https// but same issue.

 

Appreaciate your help!!!

Hi @Jonathan_Ogden , did you find a way to get the size of the videos? I only get Width and Height but that is not helpful at all for the size.

Thanks a lot!

@rrivero11 

I think you've set the 

$rootAPIlocation

to https//uswe-1.api.microsoftstream.com/api/

so that when the code creates 

$StreamAPIVideos100

it is wrong
you should set as follows:  $rootAPIlocation = "uswe-1"

 

Yes! Manage to solve that one! Thanks. Just wondering if finally you were able to obtain the size of each video, as that was the one I am looking for :) Awesome solution btw! Great job and thanks for sharing
Hi. This is "almost" working perfectly. Once I got the Data Centre and realised the URLs in PowerShell were generated to use to paste into a browser, then copy and paste to a text file with a .son extension inside a directory I had to create called VideosJSON I was away.

However... When I run the code from this blog (https://euno-1.api.microsoftstream.com/api/videos?NoSignUpCheck=1&$top=100 ... etc) , I get one page of JSON, but when I use a similar solution link here: https://techcommunity.microsoft.com/t5/microsoft-stream-forum/powershell-script-to-audit-and-export-... that calls Channels (https://euno-1.api.microsoftstream.com/api/channels?$top=100... etc ) I get two pages of JSON and more videos listed. But that code doesn't give me the duration and video.

I realised that Ryechz down below said to add this: %20and%20privacymode%20eq%20%27organization%27%20 before &adminmode

Once I removed that, I then got all the videos.

Still no size :( But I think I might be able to fudge that based on duration and height/width to at least get a rough idea. 720p HD is about 5 MB per minute

One trap for noobies is that in the scripit it first goes and purges and json files in the target directory. So if you have run this once to generate them, and realised you didn't have enough URLs, and run it a second time... so a bit of defensive code to compress-archive and move might be better :)

Oh also, I guess you could probably add Start-Process -FilePath 'chrome.exe' -ArgumentList 'https://euno-1.api.microsoftstream.com/api/videos?NoSignUpCheck=1...... etc' to where you generate the URLs to save some time.

Cool piece of work though!