Popular Post StueyMonster Posted December 4, 2012 Popular Post Posted December 4, 2012 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. Stuart Universities at Medway 8
StueyMonster Posted December 4, 2012 Author Posted December 4, 2012 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 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 Stuart 1
andydis Posted December 7, 2012 Posted December 7, 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? much appreciated.
StueyMonster Posted December 7, 2012 Author Posted December 7, 2012 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. Cheers Stuart
mac_shinobi Posted December 7, 2012 Posted December 7, 2012 (edited) 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 ? Edited December 7, 2012 by mac_shinobi
StueyMonster Posted December 7, 2012 Author Posted December 7, 2012 (edited) please share that would be great I did share a Dropbox link if you look a few posts up Yes, it uses the hostnames in the text file, so you need your DNS to be working. Otherwise the web page just shows IP addresses, which isn't so clear to students Edited December 7, 2012 by StueyMonster 1
StueyMonster Posted December 10, 2012 Author Posted December 10, 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/BattStats%20450_Changed%20Files.zip He has played around with making the icons smaller, you may find that works for you better, but let us know.
andydis Posted December 10, 2012 Posted December 10, 2012 Hi Stuart, the new layout gives me 42 viewable Laptops(with scrolling) . For some reason it just doesn't seem to manage to display them all.
fairm010 Posted March 13, 2013 Posted March 13, 2013 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! matt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now