From: Tony on
Exactly what I was looking for!

You are the sexiest man/women alive, you exude nerdness.

Thanks again...



inf wrote:

Re: Retrieve Service Account Login Information from t-SQL
17-Dec-08

On Dec 15, 12:33=A0pm, i...(a)onlyhd.tv wrote:

DECLARE @serviceaccount varchar(100)
EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\MSSQLSERVER',
N'ObjectName',
@ServiceAccount OUTPUT,
N'no_output'

SELECT @Serviceaccount as SQLServer_ServiceAccount

set @Serviceaccount =3D''

EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT',
N'ObjectName',
@ServiceAccount OUTPUT,
N'no_output'

SELECT @Serviceaccount as SQLAgent_ServiceAccount

Previous Posts In This Thread:

On Wednesday, December 17, 2008 5:13 AM
inf wrote:

Retrieve Service Account Login Information from t-SQL
I'm working an SSRS reporting system to give me about my servers and
one piece of information I want to gather the account used in the
"Login As" setting for the SQL Service and SQL Agent services?
Basically: What account are the 2 services running under.

Is this possible? If so, does anyone have any sample script of URL to
go to.. I search for the code and found nothing.

Thank you,

Erik

On Wednesday, December 17, 2008 5:14 AM
inf wrote:

Re: Retrieve Service Account Login Information from t-SQL
On Dec 15, 12:33=A0pm, i...(a)onlyhd.tv wrote:

DECLARE @serviceaccount varchar(100)
EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\MSSQLSERVER',
N'ObjectName',
@ServiceAccount OUTPUT,
N'no_output'

SELECT @Serviceaccount as SQLServer_ServiceAccount

set @Serviceaccount =3D''

EXECUTE master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT',
N'ObjectName',
@ServiceAccount OUTPUT,
N'no_output'

SELECT @Serviceaccount as SQLAgent_ServiceAccount


Submitted via EggHeadCafe - Software Developer Portal of Choice
Join Lists with LINQ - SharePoint 2010
http://www.eggheadcafe.com/tutorials/aspnet/b0c1cd0d-fe82-444e-a16e-7d3fb7d38eca/join-lists-with-linq--sh.aspx