Forum Discussion
Powershell Script to list ALL videos in your 365 Stream environment
- 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
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.25S | 360 | 640 | FALSE |
PT1H55M13.6S | 360 | 640 | FALSE |
PT56M19.6S | 360 | 640 | FALSE |
PT28M14.144S | 1080 | 1920 | FALSE |
PT1H10M34.56S | 1080 | 1920 | FALSE |
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
- rrivero11Jun 28, 2021Microsoft
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!
- Dorje-McKinnonFeb 06, 2021Steel Contributor
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
- abraraliFeb 23, 2021Copper Contributor
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?
- Dorje-McKinnonAug 05, 2021Steel Contributor
Hi abrarali , try running the new code.
It will auto open the JSON browser tabs, which you need to then manually save (ctrl + s) as JSON files into the folder you define in the script.
Once those files exist, then your CSV file will contain something.