Loop through each instance on a server

  • Quick thought, how about cmd net start and parse the output?

    😎

  • I don't want to start anything, just trying to get info. I'd like to stay with a SQL query.

    There is an exception to every rule, except this one...

  • SQLHeap (4/15/2015)


    I don't want to start anything, just trying to get info. I'd like to stay with a SQL query.

    without any parameters it only lists the services, should be easy to parse the output.

    😎

  • That lists out the services yes, but I'm looking for the account that the SQL services are running under.

    There is an exception to every rule, except this one...

  • I use powershell for this type of cross server activities. Here's an example: USING POWERSHELL TO LOOP THROUGH A LIST OF SQL SERVER DATABASES[/url]

  • Just ran your code on a multi instance box (10 running and 4 not running), all showing up in the results, could this be a permission issue?

    😎

    BTW: the services not running show up with NULLs in SQLServiceAcct and SQLAgentAcct.

  • GRRRR, doesn't work for me at home either:crazy:

    There is an exception to every rule, except this one...

Viewing 7 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply