Where to check with what account sql server is running???

  • Where to check with what account sql server is running

  • You can find the all the service accounts by looking at SQL Server 2005 Services in SQL Server Configuration Manager on the server where SQL Server is installed. Look in the "Log on as" column.

    Greg

  • First:

    DECLARE @account varchar(100)

    EXECUTE master.dbo.xp_instance_regread

    N'HKEY_LOCAL_MACHINE',

    N'SYSTEM\CurrentControlSet\Services\MSSQLSERVER',

    N'ObjectName',

    @account OUTPUT,

    N'no_output'

    SELECT @account as SQLServer_ServiceAccount

    Second:

    declare @reg_srv varchar(256),

    @reg_agent varchar(256)

    if serverproperty('instancename') is null

    begin --default instance

    set @reg_srv='SYSTEM\CurrentControlSet\SERVICES\MSSQLSERVER'

    set @reg_agent='SYSTEM\CurrentControlSet\SERVICES\SQLSERVERAGENT'

    end

    else

    begin --named instance

    set @reg_srv='SYSTEM\CurrentControlSet\SERVICES\MSSQL$'+cast (serverproperty('instancename') as sysname)

    set @reg_agent='SYSTEM\CurrentControlSet\SERVICES\SQLAgent$'+cast (serverproperty('instancename') as sysname)

    end

    exec master..xp_regread

    'HKEY_LOCAL_MACHINE', @reg_srv, 'ObjectName'

    exec master..xp_regread

    'HKEY_LOCAL_MACHINE', @reg_agent, 'ObjectName'

    go

    MJ

  • start->administrative tools->services

    scroll down, the accountson the right



    Shamless self promotion - read my blog http://sirsql.net

Viewing 4 posts - 1 through 3 (of 3 total)

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