This process requires MilestonePSTools and the MipSdkRedist modules. But it does NOT need to be installed and run on your Milestone management server. The modules are available in the PowerShell Gallery and can be installed using Install-Module MilestonePSTools -Scope CurrentUser on an internet-connected system. The MipSdkRedist module is a dependency for MilestonePSTools, so it will automatically be installed along with the MilestonePSTools module.

# 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
    )

    process {
        if ($null -eq $RecordingServer -or $RecordingServer.Count -eq 0) {
            $RecordingServer = Get-RecordingServer
        }
        foreach ($recorder in $RecordingServer) {
            foreach ($hardware in $recorder | Get-Hardware) {
                $password = $hardware | Get-HardwarePassword

                # This block will neatly format a collection of useful information
                # for each hardware object and return it in a way that can be sent
                # to Out-GridView for immediate viewing or Export-Csv to produce a
                # CSV file.
                [pscustomobject]@{
                    Hardware = $hardware.Name
                    Address = $hardware.Address
                    Username = $hardware.UserName
                    Password = $password
                    Recorder = $recorder.Name
                }
            }
        }
    }
}

# Forcefully logs out of any previous sessions, and shows a login dialog.
Connect-ManagementServer -ShowDialog -AcceptEula -Force

# This calls the function up above to generate a "password report" for all
# hardware on all recording servers.
$report = Get-HardwarePasswordReport

# This will export those results to a CSV file in your downloads folder
$report | Export-Csv -Path '~\Downloads\Milestone-Password-Report.csv' -NoTypeInformation

# This will display the same report in a sortable/searchable user interface
$report | Out-GridView

See the installation docs for more information.

The following line can simplify that installation for you if you have an internet connection and are able to run as administrator:

Set-ExecutionPolicy RemoteSigned -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex (irm 'https://www.milestonepstools.com/install.ps1')

Example output

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.