Learn how to set up a smart strobe siren system that uses Axis Object Analytics with Milestone XProtect, minimizing false…
Close
Close
Close
Close
Windows PowerShell is a powerful scripting language that can be used to automate many tasks on Windows systems. In this blog post, we will show you how to use PowerShell to find a specific video in the Windows File Explorer and view it in the Milestone XProtect player.
Finding a video using Windows File Explorer is one of the most frustrating experiences I’ve encountered. It’s basically impossible. First you’ll need to wait until Windows loads millions of files and folders. Then if, and only IF, you are lucky enough that it actually loads, you must search, sort, and dig to find the right folder. It’s the definition of a needle in a haystack situation!
It will take a toll on you. Trust me…
With not a hair left on my head, I knew I needed to find a new solution.
Enter PowerShell!
Here’s how to do it:
In Windows, file explorer XProtect uses aliases to make the folder structure human-readable. These aliases are not real folder names and are unusable in a Powershell script.
An easy way to figure out the actual folder name is to just click on the address bar in Windows file explorer.
Here is what the address bar looks like with aliases.
Here is what it looks like after clicking in. This is the actual folder name.
That long string of characters separated by dashes is generally called a GUID. So in this case, 09f85974-d9ca-4e74-bd14-195cb547f62f is the folder GUID.
Cameras also have GUIDs, and you will need to know the GUID of the camera you are trying to find the video for.
There are several ways to find the camera GUID, but the easiest way is through the management client.
Now that you have the basics, it is time to put it together. We will use the commandlet below to search our live database folder for a specific camera.
The | Out-GridView switch is optional but is super helpful. It publishes the data into an excel-like table you can sort and filter through.
Let’s try this using the info for the folder and camera GUIDs we found above:
Folder to search through:
D:\MediaDatabase\09f85974-d9ca-4e74-bd14-195cb547f62f
Camera to search through:
1E18F205-C059-4EEC-A745-E5138DBDF11D
Get-ChildItem -path D:\MediaDatabase\09f85974-d9ca-4e74-bd14-195cb547f62f -Directory -Filter *1E18F205-C059-4EEC-A745-E5138DBDF11D* | Out-GridView
Here is the output using the Out-GridView switch:
Now you can see all the folders in the file system that contain video for the specific camera without waiting ages for the folders and files to render in Windows File Explorer.
Once in grid view, you can click the “Add Criteria” button and filter the results to focus your search results further.
Lastly, you may want to browse a specific camera folder in the Name column of the grid.
To do this, take the folder path URI, and the camera folder name found in the name column and add them together, as shown below.
folder_path_url+/+ camera_folder_name
D:\MediaDatabase\09f85974-d9ca-4e74-bd14-195cb547f62f\1e18f205-c059-4eec-a745-e5138dbdf11d_LOCAL_2022-09-25_13-22-06
We hope you found this blog useful and really hope you found it in time to save you from the anguish of having to figure it out on your own.
Pay it forward by sharing this PowerShell hack with all of the security administrators you know and help them avoid countless hours of boredom and disappointment watching files load and crash repeatedly.
If you want more helpful tips and tricks for managing your video security system, sign up for our [NOT] Boring Newsletter to get a monthly dose of genius direct to your inbox.
Your go-to XProtect eXPerts. We learn the technical stuff that will save you time and make it less boring.
Your go-to XProtect eXPerts. We learn the technical stuff that will save you time and make it less boring.
Learn how to set up a smart strobe siren system that uses Axis Object Analytics with Milestone XProtect, minimizing false…
Managing a video surveillance system is not set it and forget it. In this blog we cover the importance of…
Learn how to use a PowerShell script to enforce TLS 1.2 and 1.3 on your IIS servers, improving security by…
Subscribe to get a monthly dose of security & surveillance industry news and insights, Milestone VMS time-saving tricks, tips for hacking your way out of boring work sent directly to your inbox!