Access SQL Server WMI object
Access SQL Server WMI object
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"
two。 Access using wbemtest.exe
At start, run, type wbemtest.exe
Enter the space name:
Root\ Microsoft\ SqlServer\ ComputerManagement10
Problems encountered:
When accessing wbemtest.exe, you will encounter permission problems, as follows:
At start, run, type wmimgmt.msc
Right-click WMI Control (local) and click Properties
Switch to the Security window, expand to the directory you need 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