Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Report for battery percentage for bank of laptops - classroom management


Recommended Posts

Posted

We have a 1:1 device scheme here and pupils have laptops that are intuned. Senso allows us to visually look at rough laptop percentages but Im trying to create something that each morning will pull down laptop battery percentages so I can mark those that haven't brought their laptops in charged into our behaviour management system which is essentially 2 strikes and a detention.

 

Any Ideas on how I could do this easily? Or possible via senso?

Posted
We have a 1:1 device scheme here and pupils have laptops that are intuned. Senso allows us to visually look at rough laptop percentages but Im trying to create something that each morning will pull down laptop battery percentages so I can mark those that haven't brought their laptops in charged into our behaviour management system which is essentially 2 strikes and a detention.

 

Any Ideas on how I could do this easily? Or possible via senso?

 

Afternoon

 

Not via Senso - but.. i've been having to test battery depletion stats for some devices that we are looking to replace.

 

What I've been doing is running this powershell script - which every 5 minutes writes the battery percentage to a text file. I then run VLC with a load of videos on a loop and keep the device running it shutsdown (obviously don't plug the device into the mains)...

 

Maybe you can strip out of the powershell the important part and run it via senso?

 

 

This is the powershell

 

Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope Process# Get the device name$deviceName = (Get-ComputerInfo -Property CsName).CsName# Define the path to the log file with the device name$logFile = "C:\batterystat\LogFile_$deviceName.txt"# Infinite loop to keep writing to the filewhile ($true) { # Get the current date and time $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" # Get the battery status $batteryStatus = Get-WmiObject -Namespace root\CIMV2 -Class Win32_Battery if ($batteryStatus) { $batteryLifePercent = $batteryStatus.EstimatedChargeRemaining $batteryMessage = "$batteryLifePercent% battery life remaining" } else { $batteryMessage = "Battery information unavailable (possibly on a desktop or no battery installed)" } # Construct the log message $message = "Still working - $timestamp - $batteryMessage" # Append the message to the log file Add-Content -Path $logFile -Value $message # Wait for 5 minutes (300 seconds) Start-Sleep -Seconds 300}

Posted

Looks like it broke the powershell in the input...

 

Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope Process

 

# Get the device name

$deviceName = (Get-ComputerInfo -Property CsName).CsName

 

# Define the path to the log file with the device name

$logFile = "C:\Intel\LogFile_$deviceName.txt"

 

# Infinite loop to keep writing to the file

while ($true) {

# Get the current date and time

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

# Get the battery status $batteryStatus = Get-WmiObject -Namespace root\CIMV2 -Class Win32_Battery

if ($batteryStatus) {

$batteryLifePercent = $batteryStatus.EstimatedChargeRemaining

$batteryMessage = "$batteryLifePercent% battery life remaining"

} else {

$batteryMessage = "Battery information unavailable (possibly on a desktop or no battery installed)"

}

 

# Construct the log message

$message = "Still working - $timestamp - $batteryMessage"

 

# Append the message to the log file

Add-Content -Path $logFile -Value $message

 

# Wait for 5 minutes (300 seconds)

Start-Sleep -Seconds 300

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...