Hm - well... sleep events are logged in the event logs, but are 'informational' and that category is not captured by default as it would really balloon the database size and slow it down to a crawl. BUT - you could deploy a powershell script that looks for the events and writes the latest one to the registry - which Lansweeper can then scan the keys:
# Target registry path
$regPath = "HKLM:\SOFTWARE\Lansweeper\SleepTracking"
New-Item -Path $regPath -Force | Out-Null
# Clear previous values
Remove-ItemProperty -Path $regPath -Name LastSleepTime -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $regPath -Name LastWakeTime -ErrorAction SilentlyContinue
# Define start time for filtering
$startTime = (Get-Date).AddDays(-14)
# Get the last sleep event (Event ID 42)
$sleepEvent = Get-WinEvent -FilterHashtable @{
LogName = 'System'
ID = 42
StartTime = $startTime
} | Sort-Object TimeCreated -Descending | Select-Object -First 1
# Get the last wake event (Event ID 1)
$wakeEvent = Get-WinEvent -FilterHashtable @{
LogName = 'System'
ID = 1
StartTime = $startTime
} | Sort-Object TimeCreated -Descending | Select-Object -First 1
# Write results to registry
if ($sleepEvent) {
Set-ItemProperty -Path $regPath -Name "LastSleepTime" -Value ($sleepEvent.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss"))
}
if ($wakeEvent) {
Set-ItemProperty -Path $regPath -Name "LastWakeTime" -Value ($wakeEvent.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss"))
}
Then, you can add the below to the registry scanning:
HKEY_LOCAL_MACHINE\SOFTWARE\Lansweeper\SleepTracking VALUE: LastSleepTime
HKEY_LOCAL_MACHINE\SOFTWARE\Lansweeper\SleepTracking VALUE: LastWakeTime

You can then run SQL reports for the registry keys
-Jacob