SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Find SQL Services and Accounts

By Michael D'Spain ,

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/

Total article views: 1092 | Views in the last 30 days: 1
 
Related Articles
FORUM

SQl server Stop Service

SQl server Stop Service

FORUM

Restart SQL Server services

Restart SQL Server services

FORUM

SQL Server Notification Services

SQL Server Notification Services

FORUM

Sql Server Integration Services.

Sql server Integration services.

FORUM

Audit SQL Server Service Recycle

Audit SQL Server Service Recycle

Tags
 
Contribute