You are here

Error message

  • Deprecated function: Array and string offset access syntax with curly braces is deprecated in include_once() (line 20 of /home/benjfc5/public_html/main/includes/file.phar.inc).
  • Deprecated function: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in include_once() (line 1387 of /home/benjfc5/public_html/main/includes/bootstrap.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home/benjfc5/public_html/main/includes/common.inc).

PowerShell - Getting All Running SQL Services

Getting all SQL Server services running on a server using PowerShell:

Get-WmiObject -Class sqlservice -Namespace "ROOT\Microsoft\SqlServer\ComputerManagement11" | Select ServiceName

Additionally, this can be set to an array and worked with as such.

$services = Get-WmiObject -Class sqlservice -Namespace "ROOT\Microsoft\SqlServer\ComputerManagement11" | Select ServiceName

foreach($service in $services)
{
    $service.ServiceName
}

$services[0].ServiceName
>> MSSQLSERVER

$services[1].ServiceName
>> SQLBrowser

$services[2].ServiceName
>> SQLSERVERAGENT

Categories: 
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
13 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer