![]() ![]() ![]() Select * from _InstanceModificationEvent within 10 where TargetInstance isa 'Win32_Service' The notification query used is of the format: Provider::GetObject - Win32_Service.Name=""SQLSERVERAGENT""Īfter this, it sets up a notification to get state change information using theĬlasses from System.Management. ![]() In this scenario, I am launching SSMS from a remote machine named TOKENLEAKCLIENT and connecting a SQL Server named TOKENLEAKSERVER.įirst the Object Explorer extracts information about the two services of interest from the WMI provider CIMWin32 using calls similar to the following: In order to get this information, Object Explorer connects to the WMI namespaceĪnd performs various WMI queries. One of them involves getting the service information for the two services of interest from the machine where SQL Server is running. When you launch SSMS and connect to a SQL Server, the Object Explorer window performs a lot of initializations. You will see the service status through the Green and Red color arrow icons present next to the service name.Īll of the magic to populate the information happens through WMI layer. Here is a screenshot of what we are discussing in this post: Have you ever wondered about the mechanism using which SQL Server Management Studio(SSMS) - Object Explorer shows the service status for SQL Server and SQL Agent service? We recently worked with a customer on a issue related to this and thought that this might be useful information to share out.
0 Comments
Leave a Reply. |