If you need to find the service account for SQL and the SQL Agent across the enterprise, this script will do the trick. It does require a list of Servers in which to iterate through. I have a repository database of servers and used that as my source list of servers but if you have that list in a text file use the get-content cmdlet to populate the Instance variable
Get-WmiObject win32_service will provide the necessary data for the services in question. Startname is the name of the Service Account.
After the out-file cmdlet, enter a filepath and name of the file. This script creates a pipe delimited list. I could have used export-csv but this worked just fine.
Enjoy!!
http://thesurfingdba.weebly.com/