70 lines
No EOL
2.1 KiB
PowerShell
70 lines
No EOL
2.1 KiB
PowerShell
# Get Hardware from VMS
|
|
$hardwarelist = Get-VmsCameraReport -IncludeRetentionInfo
|
|
|
|
# Create Empty table object with the right headers needed for CSV Data Import
|
|
$table = New-Object System.Data.DataTable
|
|
[void]$table.Columns.Add("company_name")
|
|
[void]$table.Columns.Add("name")
|
|
[void]$table.Columns.Add("Stream 1 - Frames per second (FPS)")
|
|
[void]$table.Columns.Add("Stream 1 - Bitrate")
|
|
[void]$table.Columns.Add("Privacy mask")
|
|
[void]$table.Columns.Add("Eigendom klant")
|
|
[void]$table.Columns.Add("Serienummer")
|
|
[void]$table.Columns.Add("MAC-adres")
|
|
[void]$table.Columns.Add("Afbeelding")
|
|
[void]$table.Columns.Add("Day-Image")
|
|
[void]$table.Columns.Add("Night Image")
|
|
[void]$table.Columns.Add("Day / Night Mode")
|
|
[void]$table.Columns.Add("Wide Dynamic Range (WDR)")
|
|
[void]$table.Columns.Add("Privacy Mask omschrijving")
|
|
[void]$table.Columns.Add("Opmerkingen")
|
|
[void]$table.Columns.Add("IP-adres")
|
|
[void]$table.Columns.Add("Model")
|
|
[void]$table.Columns.Add("Installatiedatum")
|
|
[void]$table.Columns.Add("Locatie")
|
|
[void]$table.Columns.Add("Montage")
|
|
[void]$table.Columns.Add("Exposure Time / Shutter Speed")
|
|
|
|
# Loop through the Cameralist
|
|
foreach ($camera in $hardwarelist) {
|
|
# Match HardwareID and fetch camera settings
|
|
try {
|
|
$setting = Get-VmsHardware -Id $camera.HardwareId | Get-HardwareSetting
|
|
} catch {
|
|
Write-Host "Failed to fetch data for Camera ID:" $camera.HardwareId
|
|
}
|
|
|
|
# Add data rows to table
|
|
[void]$table.Rows.Add(
|
|
$camera.RecorderName,
|
|
$camera.HardwareName,
|
|
$camera.CurrentRecordedFPS,
|
|
$camera.CurrentRecordedBitrate,
|
|
[int][bool]::Parse($camera.PrivacyMaskEnabled),
|
|
"",
|
|
$setting.SerialNumber,
|
|
$camera.MAC,
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
$camera.Address.TrimStart('http://').TrimEnd('/'),
|
|
$camera.Model,
|
|
"",
|
|
"",
|
|
"",
|
|
"")
|
|
}
|
|
|
|
# Output table
|
|
try {
|
|
$table | Export-Csv -Path .\export.csv -NoTypeInformation
|
|
Write-Host "Export created"
|
|
Disconnect-Vms
|
|
} catch {
|
|
Write-Host "Failed writing file."
|
|
Disconnect-Vms
|
|
} |