Netbooks, PDA and Phones Thread, BattStats: Display charge level of laptops before login in Technical; I originally intended to do a really nice thread for this, but over 2 years have gone by and I've ...
4th December 2012, 11:43 AM #1
BattStats: Display charge level of laptops before login
I originally intended to do a really nice thread for this, but over 2 years have gone by and I've still not got around to it, maybe now others have done something similar, I haven't looked. certainly there was nothing I could find after extensive searches when it was developed. I am hoping other institutions will want to use it and develop it beyond its current state.
After implementing laptop loans in our library, student were saying "I hate it when I pick up a laptop, take it to a study zone, log in only to find the battery is almost flat". The cheaper laptops and netbooks we buy tend not to have battery charge indicator on, so another solution was required.
In response to this we have put screens on top of all our laptop trollies, showing the charge level of all laptops in the library, students seem to like them. They grab any laptop they want, check the number on the lid against the BattStats display... simple.
Laptop Charge Levels
It's a fairly simple PowerShell script that generates and XML file. If you are interested in implementing this at your institution I will happily send you a zip of the code, as long as you share any development you do back to the community.
Universities at Medway
7 Thanks to StueyMonster:
AngryTechnician (4th December 2012), FN-GM (4th December 2012), JJonas (4th December 2012), john (4th December 2012), mac_shinobi (7th December 2012), Meldrew (10th December 2012), plexer (4th December 2012)
IDG Tech News
4th December 2012, 12:40 PM #2
4th December 2012, 12:45 PM #3
I like that very much, do share
4th December 2012, 12:46 PM #4
Please do looks pretty good!
4th December 2012, 01:51 PM #5
Yes, would like to give that a try he also!
4th December 2012, 02:25 PM #6
Here are the files in their native form (suitable for our environment): https://dl.dropbox.com/u/1487955/BattStats.zip
It's pretty self-explanatory and easy to implement if you already have a server with IIS on it that you can stick it on. Make sure that server can run PowerShell scripts remotely on the laptops, you may need to allow WMI on the clients firewall. Initial try running the command:
get-wmiobject -class win32_battery -computername <ip or hostname here>
Once you have that working, populate your laptops.txt list with all your hostnames and you should be good to go. If you have a smaller or larger number of laptops to us, you will need to alter the index.htm to get the layout correct.
Finally, get a gold star from your boss, because students have been complaining about not being able to see the charge levels for laptops for ages
The script just loops continuously and will take longer to run the more when more laptops are offline and obviously the more you have, ours completes 106 devices (4 have been stolen so removed from the list) in about 90 seconds, the page is set to refresh every 60 seconds. I set it to run as a scheduled task every morning at 8am for 23 hours. We don't sleep the laptops in the day, just switch the display off when the lid is shut. We sleep them after close at midnight, and they wake and perform a restart at 8am.
Myself and my colleague Rob will try to help where we can, but we're fairly busy with student hand-in time for the next few weeks.
Thanks to StueyMonster from:
JJonas (4th December 2012)
7th December 2012, 03:29 PM #7
Stuart this is amazing and I have implemented for all my laptops (450 of them), they are all inputted correctly into the laptops.txt and the powershell script runs fine!
But I cannot "edit the index.html" to accommodate them all, it only shows the first 30, i have exhausted my knowledge of HTML "tables" , any help anyone?
7th December 2012, 03:36 PM #8
Great, good to hear someone has tried it. Rob did the web code for me, I think he understands the ins and outs better, but to enable us to help, can you tell us what res you will be running the screens at and how many are on each screen? I think about 120 would be the max I would fit on a single 16:9 screen without the need for scrolling (we don't have a keyboard or mouse on our cabinets). Are you having multiple screens?
Basically, if you can give me as many details as possible, I'm sure we can help.
I'd also be interested to hear what company/institution you are from, you can PM me that info if you prefer.
7th December 2012, 03:51 PM #9
please share that would be great
edit - no way to make it loop through an ip range or are you using the list of computer names in the text file as the way of enumerating through each of the computers ?
Last edited by mac_shinobi; 7th December 2012 at 03:57 PM.
7th December 2012, 03:56 PM #10
Last edited by StueyMonster; 7th December 2012 at 03:59 PM.
Thanks to StueyMonster from:
mac_shinobi (7th December 2012)
7th December 2012, 03:57 PM #11
10th December 2012, 10:42 AM #12
Hi Andy, here are the files for 450, you can compare them with the originals to see what Rob has changed. https://dl.dropbox.com/u/1487955/Bat...ed%20Files.zip
He has played around with making the icons smaller, you may find that works for you better, but let us know.
10th December 2012, 11:12 AM #13
the new layout gives me 42 viewable Laptops(with scrolling) . For some reason it just doesn't seem to manage to display them all.
13th March 2013, 09:15 AM #14
I'm new to powershell and am keen to get this implemented!
Could somebody tell me what to do with the powershell script? and once that is working how i implement it in GP?
I have the battstats site set up and working in IIS, i just need to populate the list now!
By not_rich_yet in forum Windows Server 2008 R2
Last Post: 8th May 2012, 09:27 AM
By projector1 in forum General Chat
Last Post: 15th March 2007, 10:26 PM
By browolf in forum Windows
Last Post: 12th March 2007, 04:05 PM
By maniac in forum Wireless Networks
Last Post: 8th February 2007, 10:52 PM
By tosca925 in forum Hardware
Last Post: 30th January 2006, 11:09 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)