views:

192

answers:

1

Hi, i am playing with Powershell and SQL WMI events and i am wondering if i can do this stuff remotely from the admin notebook:

I'd like to query the "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER" namespace:

On SQLServer directly:

get-wmiobject -list -namespace "root\Microsoft\SqlServer" >> Works!

get-wmiobject -list -namespace "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER" >> Works !

On my Adminmachine:

get-wmiobject -list -namespace "root\Microsoft\SqlServer" >> Works!

get-wmiobject -list -namespace "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER" >> Error: Invalid Namespace.

Is there a trick to get this running? Do i have to additional install sth? I am still on SQL 2005.

Thanks!

+1  A: 

Use the computername name parameter.

get-wmiobject -computername Z002 -list -namespace "root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER"

Also keep in mind MSSQLSERVER is only available if the server has a default instance. If the server uses a named instance you'll need to specify the instance name instead of MSSQLSERVER.

Chad Miller
Thanks a lot, with the -computername it works fine.I've got a permission issue now but thats another topic ;-)
icnivad