尋找類似的東西?
XP_WMIV3_DLL is a Extended Sqlserver Procedure for Quering WMI.
This package includes versions for 32-bit and 64-bit SQL servers.
Currently tested under SQL-Server 2005 and SQL-Server 2008.
download: http://bummisoft.de/download/XP_WMI.zip
Installation:
EXEC sp_addextendedproc xp_wmiv3, '<Your Path>\XP_WMIV3_DLL.dll'
eg: EXEC sp_addextendedproc xp_wmiv3, 'C:\DLLs\XP_WMIV3_DLL.dll'
Uninstallation
EXEC sp_dropextendedproc xp_wmiv3
Usage
e.g.
exec xp_wmiv3 'SELECT * FROM Win32_Volume'
exec xp_wmiv3 'SELECT * FROM CIM_Userdevice where Name like "%HID%"'
exec dbo.xp_wmiv3 'Select * from win32_perfformatteddata_perfproc_process where name=''sqlservr'''
Create table #tmp(Domain varchar(255),Name varchar(255),Sid varchar(255))
insert into #tmp Exec xp_wmiV2 'SELECT Domain,SID,Name FROM Win32_UserAccount where Status ="OK"'
Select * from #tmp
Drop Table #tmp
Be aware that some querys my last very long, some won't return at last.
Covered namespaces in this version depend on local - root\CIMV2
究竟是什麼WMI.Service對象/類/什麼?你正在尋找[SMO服務類](http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.wmi.service.aspx)? – Pondlife
這個問題已經標記爲SMO,所以是的,這是一個很好的猜測。我已經更新了代碼,使其更清晰一些。 –