Jump to content

Recommended Posts

Posted

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

  • Thanks 1
Posted

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.

Posted

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

Posted (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 by mac_shinobi
Posted (edited)
please share that would be great :)

 

I did share a Dropbox link if you look a few posts up :yo:

 

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 by StueyMonster
  • Thanks 1
  • 3 months later...
Posted

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

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...