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
That is awesome.
I like that very much, do share
Please do looks pretty good!
Yes, would like to give that a try he also!
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.
JJonas (4th December 2012)
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?
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.
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 04:57 PM.
Last edited by StueyMonster; 7th December 2012 at 04:59 PM.
mac_shinobi (7th December 2012)
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.
the new layout gives me 42 viewable Laptops(with scrolling) . For some reason it just doesn't seem to manage to display them all.
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!
There are currently 1 users browsing this thread. (0 members and 1 guests)