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

clip_image001

输入空间名:  
root\Microsoft\SqlServer\ComputerManagement10

clip_image002

clip_image003

clip_image004


遇到的问题:

在访问wbemtest.exe时,会遇到权限问题,如下:

clip_image005

在开始、运行,输入wmimgmt.msc

clip_image006

右键WMI Control(local),点击Properties

clip_image007

切换到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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值