The content below is taken from the original ( in /r/ sysadmin), to continue reading please visit the site. Remember to respect the Author & Copyright.
This is going to sound petty, but when the person in question doesn't listen to multiple requests to resolve the situation, you have to do something about it. Sorry in advance for the rant.
TL;DR I set up a script to monitor SONOS volume across the network and aggressively turn it down when necessary.
A couple of years ago, one of the C-levels, who is in the office maybe once every 2 months, decided it would be a great idea to spend money on a few SONOS speakers dotted around the office. Speaker locations include the main (open-plan) office, as well as the break room. Nobody asked for this, 90% of the office was happy in a nice quiet environment. To make it worse, multiple requests for "Can we get rid of the SONOS" have been met with "No."
There's a few problems with the situation:
- We aren't allowed to change the station. It's playing 70s/80s hits, and the average demographic in the office is a 25 y.o. male.
- Someone not in my team keeps turning the volume up to a level that is absolutely unacceptable for an open plan office. People are trying to make support calls and just get shit done in general.
- Noone wants to listen to Marcia Hines on their lunch break – we just want to chat about video games and football.
After coming into the office and hearing ABBA blasting across the room for the 50th time, I'd had enough. Surely someone has written a script that can communicate with the SONOS across the network so I don't have to keep whipping my phone out to set volume levels to something acceptable??
Cue this gem – https://gallery.technet.microsoft.com/SONOS-PowerShell-500c9878
I used this script as a base, and edited it to support the 'GetVolume' command, as well as supporting multiple devices read from an external CSV file.
Each device has a Name, IP, and VolumeLimit. When you run the script with the -auto switch, it polls the devices on the network every 10 seconds, and checks if the device is above the volume level set in the CSV file. If the volume is above the specified maximum, it immediately hits the endpoint to set the volume back down to the limit. I've set a limit for the main office to "just above background noise", and for the break room the limit is zero.
The script is working perfectly and has already saved us from bleeding ears a few times this week. Whoever has been turning it up hasn't mentioned that the volume control doesn't seem to work anymore…
If anyone wants the script, happy to chuck it on paste bin or something.
EDIT: script here https://pastebin.com/hmc3QA8z