→ The Lansweeper Customer Excellence Awards 2024 - Submit Your Project Now! Learn More & Enter Here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MikeRigsby
Engaged Sweeper III
Not sure how to describe what I'm looking for and I hate posting in forums because chances are what I'm looking for is in here somewhere and I'm just not finding it.

I have a large number of PCs that Power On through an RTC Alarm in BIOS and then Power Off by a Scheduled Task running Shutdown.exe

Problem is that I honestly don't know if they all do 'as they're told' because Scheduled Tasks is notoriously unreliable.

So is there a way to generate a report logging the power events from the System eventlog or similar?

1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
Lansweeper scans power on and power off events. After successfully scanning your Windows computers, create a report with the following SQL code in order to list these events for all active computers in the past 3 days:

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblUptime.EventTime As [event time],
Case tblUptime.EventType When 1 Then 'power on' When 2 Then 'power off'
Else 'unknown' End As [event type]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblUptime On tblAssets.AssetID = tblUptime.AssetId
Where tblUptime.EventTime > GetDate() - 3 And tblAssetCustom.State = 1
And tblUptime.EventType In (1, 2)
Order By tblAssets.AssetName

View solution in original post

2 REPLIES 2
MikeRigsby
Engaged Sweeper III
Works great. Thank you very much.
Daniel_B
Lansweeper Alumni
Lansweeper scans power on and power off events. After successfully scanning your Windows computers, create a report with the following SQL code in order to list these events for all active computers in the past 3 days:

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblUptime.EventTime As [event time],
Case tblUptime.EventType When 1 Then 'power on' When 2 Then 'power off'
Else 'unknown' End As [event type]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblUptime On tblAssets.AssetID = tblUptime.AssetId
Where tblUptime.EventTime > GetDate() - 3 And tblAssetCustom.State = 1
And tblUptime.EventType In (1, 2)
Order By tblAssets.AssetName