examples/Export-BcdrInventory.ps1
|
[CmdletBinding()] param( [Parameter()] [string]$OutputPath = '.\Datto-BCDR-Inventory.csv' ) $devices = Get-DattoBcdrDevice -All -ShowHiddenDevices 1 $report = foreach ($device in $devices) { [pscustomobject]@{ OrganizationId = $device.organizationId OrganizationName = $device.organizationName SerialNumber = $device.serialNumber DeviceName = $device.name Model = $device.model RegionLocation = $device.region.location RegionProvider = $device.region.provider LastSeenDate = $device.lastSeenDate RegistrationDate = $device.registrationDate WarrantyExpire = $device.warrantyExpire ServicePlan = $device.servicePlan Hidden = $device.hidden AgentCount = $device.agentCount ShareCount = $device.shareCount AlertCountLast24Hours = $device.alertCount UptimeSeconds = $device.uptime RemoteWebUrl = $device.remoteWebUrl } } $report | Export-Csv -LiteralPath $OutputPath -NoTypeInformation -Encoding UTF8 Get-Item -LiteralPath $OutputPath |