当前位置:Gxlcms > 数据库问题 > 访问SQL Server WMI对象

访问SQL Server WMI对象

时间:2021-07-01 10:21:17 帮助过:12人阅读


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


本文出自 “SQL Server Deep Dive” 博客,请务必保留此出处http://ultrasql.blog.51cto.com/9591438/1906045

访问SQL Server WMI对象

标签:powershell   wmi   wql   

人气教程排行