I have over 60 servers and am looking for some code that will allow me to
query for the Startup Account user ('system' or some domain account). Where
is this information stored?
--
The Spirit gives life; the flesh counts for nothing! (Jn 6:63)There are many programming interfaces to that property. I typically like to
use command line utility to grab the information from each server, and parse
the text for the service account info. For instance, you can use NT resource
kit tool sc.exe for this purpose.
Linchi
"Blue Sky" wrote:
> I have over 60 servers and am looking for some code that will allow me to
> query for the Startup Account user ('system' or some domain account). Whe
re
> is this information stored?
> --
> The Spirit gives life; the flesh counts for nothing! (Jn 6:63)|||Then, this info is stored in the registry? I would prefer to stay within
SQL, where i can use the xp_regread(). Where in the registry is the
information stored?
--
The Spirit gives life; the flesh counts for nothing! (Jn 6:63)
"Linchi Shea" wrote:
[vbcol=seagreen]
> There are many programming interfaces to that property. I typically like t
o
> use command line utility to grab the information from each server, and par
se
> the text for the service account info. For instance, you can use NT resour
ce
> kit tool sc.exe for this purpose.
> Linchi
> "Blue Sky" wrote:
>|||Execute something like this on your SQL Server instance:
DECLARE @.key nvarchar(100)
SELECT @.key = 'SYSTEM\CurrentControlSet\Services' +
CASE @.@.SERVICENAME
WHEN 'MSSQLSERVER' THEN 'MSSQLSERVER'
ELSE 'MSSQL$' + @.@.SERVICENAME
END
SELECT @.key
DECLARE @.test varchar(20)
EXEC master..xp_regread @.rootkey='HKEY_LOCAL_MACHINE',
@.key= @.key,
@.value_name='ObjectName',
@.value=@.test OUTPUT
SELECT @.test
Regards
Pawel Potasinski
[http://www.potasinski.pl]
Uytkownik "Blue Sky" <BlueSky@.discussions.microsoft.com> napisa w
wiadomoci news:4A6CB5CF-2203-42B1-B209-E9EEB8125632@.microsoft.com...
>I have over 60 servers and am looking for some code that will allow me to
> query for the Startup Account user ('system' or some domain account).
> Where
> is this information stored?
> --
> The Spirit gives life; the flesh counts for nothing! (Jn 6:63)
No comments:
Post a Comment