Forum Discussion
Dorje-McKinnon
Oct 07, 2020Iron Contributor
Powershell Script to list ALL videos in your 365 Stream environment
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 figur...
- Oct 22, 2022
Anyone looking at this script should also look at the PowerShell script that was released by Microsoft as part of the Stream (Classic) migration tools. The PowerShell script released by Microsoft can be downloaded directly from Stream (Classic) admin page and also has a PowerBI Desktop template that can be used to analyze the output CSVs.
See this part of the migration help articles for more info:
https://learn.microsoft.com/stream/streamnew/migration-details#stream-classic-video-report
ConradMurray
Jul 06, 2021Brass Contributor
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-channel-content-details-of/m-p/354832 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!
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-channel-content-details-of/m-p/354832 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!
JavierBach
Oct 22, 2022Copper Contributor
ConradMurray Hi there is a way to get who uploaded the video ?
Thanks