Ist es möglich, mit der PrtgAPI eine Liste zu bekommen, mit allen Seriennummern mit den dazugehörigen Geräten?
Bis jetzt habe ich den folgenden Befehl:
/api/table.csv?id=40&content=sysinfo&category=system&columns=_displayname,_value
Allerdings möchte ich die Seriennummer von allen Geräten und nicht nur von einem.
Article Comments
You can easily retrieve the serial numbers of all devices with PrtgAPI
C:\> Get-Device | Get-SystemInfo system | where name -like "*serial*"
Name DeviceId Property Id Value
---- -------- -------- -- -----
Bios Serial Number 8701 Bios Serial Number ABC123
Bios Serial Number 9458 Bios Serial Number XYZ456
Bios Serial Number 9508 Bios Serial Number EFG789
...
However, I strongly recommend you don't do this, as PRTG provides no guarantee that devices will contain this information. In practice, you will likely find that many of your devices are missing many of their system information types. If PRTG does not have this information for a specified device, `Get-SystemInfo` will simply return nothing.
If you are auditing Windows devices and have access to the domain, I strongly recommend you instead consider using WMI to audit serial numbers. If you wish to limit this to just the devices in PRTG, you can just the Get-Device (optionally specifying some type of filter) instead of doing Get-ADComputer on the Domain Controller
$devices = Get-Device
$results = @()
foreach($device in $devices)
{
$serial = (gwmi win32_bios -computername $device.Host).SerialNumber
$obj = [PSCustomObject]@{
Name=$device.Name
Host=$device.Host
Serial=$serial
}
$results += $obj
}
$results
If you don't speak English, hopefully this post turns out well in Google Translate!
Regards,
lordmilko
Oct, 2018 - Permalink
You can easily retrieve the serial numbers of all devices with PrtgAPI
However, I strongly recommend you don't do this, as PRTG provides no guarantee that devices will contain this information. In practice, you will likely find that many of your devices are missing many of their system information types. If PRTG does not have this information for a specified device, `Get-SystemInfo` will simply return nothing.
If you are auditing Windows devices and have access to the domain, I strongly recommend you instead consider using WMI to audit serial numbers. If you wish to limit this to just the devices in PRTG, you can just the Get-Device (optionally specifying some type of filter) instead of doing Get-ADComputer on the Domain Controller
If you don't speak English, hopefully this post turns out well in Google Translate!
Regards,
lordmilko
Oct, 2018 - Permalink