訪問SQL Server WMI對象
1. 使用Powershell訪問
get-wmiobject -list -namespace "root\Microsoft\SqlServer" get-wmiobject -list -namespace "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER" get-wmiobject -namespace "root\Microsoft\SqlServer\ComputerManagement10" -query "Select * From SqlService"
2. 使用wbemtest.exe訪問
在開始、運行,輸入wbemtest.exe
輸入空間名:
root\Microsoft\SqlServer\ComputerManagement10
遇到的問題:
在訪問wbemtest.exe時,會遇到權限問題,如下:
在開始、運行,輸入wmimgmt.msc
右鍵WMI Control(local),點擊Properties
切換到Security窗口,展開到需要訪問的目錄,授予DX\xucy訪問權限。
參考:
https://mattsql.wordpress.com/2013/08/15/quick-tip-wmi-alerts-and-sql-server-agent-permissions/
http://stackoverflow.com/questions/2056056/access-sql-wmi-namespaces-from-remote-machine
http://www.jb51.net/article/52489.htm
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。