Beg*_*DBA 5 sql-server sql-server-2014 service-accounts
这可能是一个简单的问题,但我搜索了很多却找不到。
是否有 sql 查询或我可以在注册服务器上运行来查找所有正在运行的 sql 相关服务的列表,例如 ssis 、 ssas 、 ssrs 、 sql 、 agent 、 broswer 等...
尝试谷歌搜索并可以找到 sys.dm_server_services dmv 但它没有显示所有正在运行的服务
我从这篇文章中得到的 SQL--> Powershell 脚本。也许是这样的? http://hubpages.com/technology/Using-xp_cmdshell-to-Query-the-Windows-File-System。
我使用与网络中服务器的注册服务器连接在桌面的 SSMS 上运行此程序。
**最初是为 IPCONFIG 测试而设计的,但您可以将其调整为网络启动。
--Enable SQL->PowerShell
EXEC sp_configure 'show advanced options', 1;
GO
Reconfigure;
GO
EXEC sp_configure 'xp_cmdshell',1
GO
Reconfigure
GO
--Run 'net start' command from SQL Server
--1) Create the table
CREATE TABLE #cmdNetStartRun
(outputvalue VARCHAR(3000)
,outputDate DATETIME2 DEFAULT GETDATE());
--2) Run the cmd and insert the output into the table
INSERT INTO #cmdNetStartRun(outputvalue)
exec xp_cmdshell 'net start';
--3) Select from the table
SELECT outputvalue, outputDate
FROM #cmdNetStartRun
WHERE outputvalue LIKE '%SQL%';
--4) Drop the Table
DROP TABLE #cmdNetStartRun;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4227 次 |
最近记录: |