To find out on which server and services the account is being used for

We have around 300 Windows servers in our environment. There was a need to find out on which servers and services a particular accound is being used. Follwoing is the query which can determine those server names and relevant service which are running under this account.

Have all of your servers in serverlist.txt and pass this in following powershell script.

$Computers = get-content “serverlist.txt Path”
foreach ($i in $Computers)
{get-wmiobject Win32_Service  -ComputerName $i |
where-object {$_.StartName -eq “AccountName” } |
format-table $i, Name, StartName}

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

Along with technical learning I would like to share some great articles for anyone interested in the betterment of his/her family life

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