This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Measure-SequenceData { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [VideoOS.Platform.ConfigurationItems.Camera] | |
| $Camera, | |
| [Parameter()] | |
| [DateTime] | |
| $Start = [DateTime]::MinValue, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Modules 'MilestonePSTools' | |
| function Get-ViewGroup { | |
| <# | |
| .SYNOPSIS | |
| Removes an existing View Group and all the views and groups present within that View Group | |
| .DESCRIPTION | |
| Working with View Groups is not currently supported in MIP SDK, however the redistributable SDK | |
| includes an assembly containing the VmoClient which is a component used internally by the SDK | |
| and applications like XProtect Management Client. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Find-MediaDb { | |
| $config = [xml](Get-Content 'C:\ProgramData\Milestone\XProtect Recording Server\Offline\ConfigurationDataset.xml') | |
| Write-Output $config.Cache.ConfigurationDataSet.RecordingStorage | |
| Write-Output $config.Cache.ConfigurationDataSet.ArchiveStorage | |
| } | |
| function Test-Xml { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Set-MotionDetection { | |
| [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] | |
| param( | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [VideoOS.Platform.ConfigurationItems.Camera] | |
| $Camera, | |
| [Parameter()] | |
| [switch] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script requires the sqlserver module and milestonepstools | |
| # Instead of using the #Requires -Modules ... directive, we'll check for the presence | |
| # of the modules and install them in CurrentUser scope automatically. This way | |
| # the script can be copied and pasted, or downloaded and executed. | |
| foreach ($module in 'sqlserver', 'milestonepstools') { | |
| if ($null -eq (Get-Module $module -ListAvailable -ErrorAction Ignore)) { | |
| Install-Module -Name $module -Scope CurrentUser -Force -Confirm:$false -SkipPublisherCheck -AllowClobber -ErrorAction Stop | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generic function which can take a device group from Get-DeviceGroup and go backwards to determine the full hierarchy of the device group path. | |
| function Resolve-DeviceGroupPath { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [VideoOS.Platform.ConfigurationItems.IConfigurationItem] | |
| $DeviceGroup | |
| ) | |
| process { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Modules MilestonePSTools, MilestonePSTools.ViewGroups | |
| <# | |
| This sample shows how you could copy all view groups defined in child sites within a Milestone Federated Hierarchy up to the parent | |
| site. This way local users can login to their child-site directly, and create/use views defined there, and users logging in to the | |
| parent site can get a copy of those same views. | |
| With only a little more effort, this could be setup as a scheduled task to run daily to keep views at the parent site in sync with | |
| the child sites. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Set-NtpServer { | |
| [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] | |
| param( | |
| [Parameter(Mandatory)] | |
| [ValidateNotNullOrEmpty()] | |
| [string[]] | |
| $Source | |
| ) | |
| process { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-DeviceStatusReport { | |
| $cameraKind = Get-Kind -List | Where-Object DisplayName -eq 'Camera' | Select-Object -ExpandProperty Kind | |
| $groupedCameras = Get-PlatformItem -Kind $cameraKind | Select-Object @{Name='RecorderId'; Expression={$_.FQID.ServerId.Id}}, @{Name='CameraId'; Expression={$_.FQID.ObjectId}} | Group-Object RecorderId | |
| foreach ($group in $groupedCameras) { | |
| $recorder = Get-RecordingServer -Id $group.Name | |
| try { | |
| $svc = Get-RecorderStatusService2 -RecordingServer $recorder | |
| $cameraStatusArray = $svc.GetCurrentDeviceStatus((Get-Token), $group.Group.CameraId).CameraDeviceStatusArray | |
| [pscustomobject]@{ | |
| Recorder = $recorder.Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-VmsDeviceStatistics { | |
| [CmdletBinding()] | |
| param( | |
| # Specifies the Recording Server from which to return all available camera statistics. | |
| [Parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'PerRecorder')] | |
| [VideoOS.Platform.ConfigurationItems.RecordingServer] | |
| $RecordingServer, | |
| # Specifies a Camera object from Get-Camera. The Recording Server will be discovered from the Camera object, and statistics will be returned for the one device. | |
| [Parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'PerCamera')] |