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-VmsConfigPassword { | |
| <# | |
| .SYNOPSIS | |
| Reads the Milestone XProtect Advanced VMS configuration password | |
| .DESCRIPTION | |
| The configuration password is used to securely encrypt a unique | |
| encryption key in the Surveillance SQL database. This encryption key is | |
| used to protect sensitive data such as camera credentials and licensing | |
| data. To protect this encryption key, a configuration password can be | |
| set by the admin. Here's how the configuration password is used: |
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-CertKeyPermission { | |
| [CmdletBinding(SupportsShouldProcess)] | |
| param( | |
| # Specifies the certificate store path to locate the certificate specified in Thumbprint. Example: Cert:\LocalMachine\My | |
| [Parameter()] | |
| [string] | |
| $CertificateStore = 'Cert:\LocalMachine\My', | |
| # Specifies the thumbprint of the certificate to which private key access should be updated. | |
| [Parameter(Mandatory, ValueFromPipelineByPropertyName)] |
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 Trace-VmsAlarms { | |
| <# | |
| .SYNOPSIS | |
| Polls a Milestone XProtect Event Server for new alarmline entries | |
| .DESCRIPTION | |
| Starts a polling loop to ask for new alarmline entries from a Milestone XProtect Event | |
| Server. The InitialStartTime is "now" by default, so only new alarms are returned. You | |
| can either pipe the alarms to a Foreach-Object and process them there, or provide a | |
| scriptblock which will be invoked once for each alarm returned. | |
| .EXAMPLE |
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
| class CidrInfo { | |
| [string] $Cidr | |
| [IPAddress] $Address | |
| [int] $Mask | |
| [IPAddress] $Start | |
| [IPAddress] $End | |
| [IPAddress] $SubnetMask | |
| [IPAddress] $HostMask |
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
| $loginSettings = Get-LoginSettings | |
| Get-Site -ListAvailable | Where-Object { $_.FQID.ServerId.Id -in $loginSettings.Guid } | Foreach-Object { | |
| $site = $_ | |
| $site | Select-Site | |
| $storageMap = @{} | |
| Get-RecordingServer | Foreach-Object { | |
| $rec = $_ | |
| $rec.StorageFolder.Storages | ForEach-Object { $storageMap.($_.Path) = $_.DiskPath } | |
| $rec | Get-Hardware | Foreach-Object { | |
| $hw = $_ |
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-VmsStorageRetention { | |
| <# | |
| .SYNOPSIS | |
| Gets a [timespan] representing the storage retention for the specified storage configuration | |
| .DESCRIPTION | |
| A Milestone Storage object represents both the overall storage configuration and the live | |
| storage information for that storage configuration. It has ArchiveStorage child items for each | |
| archive path associated with that storage configuration. To determine the retention for the | |
| whole storage configuration, you need to find the largest "RetainMinutes" value between the |
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
| class HostsFileEntry { | |
| [IPAddress] $IP | |
| [string[]] $Hosts | |
| [string] ToString() { | |
| return "$($this.IP) $([string]::Join(' ', $this.Hosts))" | |
| } | |
| } | |
| function Get-HostsFileEntry { |
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-PlaybackInfo2 { | |
| [CmdletBinding()] | |
| param ( | |
| # Accepts a Milestone Configuration Item path string like Camera[A64740CF-5511-4957-9356-2922A25FF752] | |
| [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName, ParameterSetName = 'FromPath')] | |
| [ValidateScript( { | |
| if ($_ -notmatch '^(?<ItemType>\w+)\[(?<Id>[a-fA-F0-9\-]{36})\]$') { | |
| throw "$_ does not a valid Milestone Configuration API Item path" | |
| } | |
| if ($Matches.ItemType -notin @('Camera', 'Microphone', 'Speaker', 'Metadata')) { |
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 Register-VmsServer { | |
| <# | |
| .SYNOPSIS | |
| Performs the registration of all Milestone services on the targetted computer. | |
| .DESCRIPTION | |
| The Milestone Server Configurator utility, from version 2020 R3, provides a | |
| command-line interface (CLI) supporting the registration of services to a | |
| specified management server. |
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 is an example function showing how you might use the Get-HardwarePassword cmdlet | |
| # to retrieve passwords for camera hardware objects. | |
| function Get-HardwarePasswordReport { | |
| [CmdletBinding()] | |
| param ( | |
| # Optionally specify one or more recording servers from which to report hardware passwords | |
| [Parameter()] | |
| [VideoOS.Platform.ConfigurationItems.RecordingServer[]] | |
| $RecordingServer | |
| ) |