Find out which server and services are running under a specific account

We manage 600 servers in a critical environment. There was a need to find out the list of services in the servers which are being run under one specific account. Following goes the script. Have your servers in the serverlist.txt and pass that in the following powershell script.

Unrelated nice feed: http://mssqlcorruptiontackle.blogspot.com/2010/12/mssql-server-dbcc-loginfo-status-2-log.html

Also pass the information of specific account in the following script.

$Computers = get-content “serverlist.txt path”
foreach ($i in $Computers)
{$service= get-wmiobject Win32_Service  -ComputerName $i |where-object {$_.StartName -eq “Account Name” }
write-host $i, $service.name, $service.startname
 }
Another Nice wire: http://mssqlcorruptiontackle.blogspot.com/2010/12/ms-sql-corruption.html

INTERVIEW PREPARATION IN 30 MINs – Read Following wires for a quick interview preparation.

  1. SQL Server DBA “Interview Questions And Answers”
  2. SQL Azure Interview Questions and Answers Part – 1
  3. SQL Azure Interview Questions and Answers Part – 2
  4. Powershell Interview Questions and Answers

Regards,
Online Powershell Classes @ http://tuitionaffordable.webstarts.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s