The other day, I came across this Reddit post on r/sysadmin:
https://reddit.com/r/sysadmin/s/FkC30bMxCJ
The OP explains that his CEO has requested that he make confetti appear on everyone’s screen simultaneously to celebrate a milestone. I found the absurdity of the request hilarious. And, I took it as a challenge to script something similar- but I took the creative liberty of deciding to Rick Roll the target devices instead.
Some weeks ago, I created my Invoke-Note and Invoke-Tune functions as a preliminary step in this endeavor. I wanted to be able to generate the music locally rather than pulling from the web. But, I did not have a great solution to execute to the target devices. Of course, a MECM deployment would make quick work of it, but I wanted something lightweight. I considered this an exercise, and was determined to find a way. In the weeks that have followed, I have been learning about and working with PsExec of the Windows Sysinternals suite to execute scripts to gather system information for diagnostics.
PsExec allows one to execute scripts on systems that may not have PowerShell remoting, WinRM, or IIS enabled. And, using the appropriate switches, it allows for such actions to take place within the current interactive session! This is perfect for Rick Rolling the target devices!
So, I had my means of execution and the music portions down, now I needed a visual component. Thanks to Filip Mårtensson @ https://github.com/fenwikk for his MIT-Licensed RickRoll project. I was able to reverse-engineer his looping ASCII animation and modify it for my use case, and integrate my musical component as well.
So, the final product, while it does have a dependency on the lightweight PsExec, it has no other external dependencies and is self-contained. Unlike so many examples I have seen, my script does not need to call to the web to stream music or video, as I found that undesirable.
Here it is in action:
Here is the GitHub repo link: https://github.com/p8nflnt/RickRoll/tree/main