Accessing SQL Server WMI objects
1. Access using 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. Access using Wbemtest.exe
At start, run, enter Wbemtest.exe
650) this.width=650; "title=" clip_image001 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image001" src= "Http://s3.51cto.com/wyfs02/M00/8E/9A/wKiom1jGhWWRTEHsAAA1XAUjT2E203.png" height= "380"/>
Enter a space name:
Root\microsoft\sqlserver\computermanagement10
650) this.width=650; "title=" clip_image002 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image002" src= "http://s3.51cto.com/wyfs02/M01/8E/9A/wKiom1jGhWbil0GbAAAqsfZWPUk102.png" height= "/>"
650) this.width=650; "title=" clip_image003 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image003" src= "http://s3.51cto.com/wyfs02/M01/8E/98/wKioL1jGhWaivGa3AAAPAjjAbwc547.png" height= "/>"
650) this.width=650; "title=" clip_image004 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image004" src= "Http://s3.51cto.com/wyfs02/M02/8E/98/wKioL1jGhWegfBPMAAAhUtQQgWY366.png" height= "305"/>
Problems encountered:
When you access Wbemtest.exe, you encounter permissions issues, as follows:
650) this.width=650; "title=" clip_image005 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image005" src= "Http://s3.51cto.com/wyfs02/M02/8E/98/wKioL1jGhWey3C04AABPR9CONqw071.png" height= "455"/>
At start, run, enter Wmimgmt.msc
650) this.width=650; "title=" clip_image006 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image006" src= "Http://s3.51cto.com/wyfs02/M00/8E/9A/wKiom1jGhWiQfOHGAAAicmTpBW0649.png" height= "252"/>
Right-click WMI Control (local), tap properties
650) this.width=650; "title=" clip_image007 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px, "border=" 0 "alt=" clip_ image007 "src=" http://s3.51cto.com/wyfs02/M01/8E/9A/wKiom1jGhWjz7-XuAAA0cqY_KYg122.png "height=" 449 "/>
Switch to the Security window, expand to the directory you want to access, and grant Dx\xucy access.
Reference:
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
This article is from the SQL Server deep Dive blog, so be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1906045
Accessing SQL Server WMI objects