Today, I received a really simple request. There was an UPDATE statement that had to be run on quite a few databases in multiple instances. This was for a vendor software we use and the statement was sent to me by a Helpdesk professional who manages the product.
You need to have the SQLPS (older) or the SQLSERVER (newer) PowerShell module installed.
Click through for the code. If you want to extend this further, I’d look at using a Central Management Server to pull the instances and maybe looking at parallel processing if you have a large number of servers.