欢迎光临
我们一直在努力

访问SQL Server WMI对象

访问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

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。