![]() Set colListOfServices = objWMIService.ExecQuery _ Set objWMIService = GetObject("winmgmts:" _ The answer was that services are case sensitive, it should have been Pop3Svc not pop3svc.ĭim objWMIService, objItem, objService, strServiceListĭim colListOfServices, strComputer, strService However, there are two reasons for this, firstly a complete list of A-Z would go off screen, secondly, I will let you into a secret, I was troubleshooting the why pop3svc would not work. I know it’s eccentric that you only get a list from ‘N’ to ‘Z’. Double click Service.vbs and check the list of Services.Which machine on your network do you wish to check? Change line 15:.Copy and paste the example script below into notepad or a VBScript editor.Instructions for Creating Your List Services WMI Script The Win32_Service Class works for most clients, XP, W2K, even NT 4.0 and Win 9x. For instance, the main WMI script may fail because we type in the wrong name for the service, by getting a list we can be sure to spell the name of the Windows service correctly. My reasoning is to build up gradually, and also to provide a script to help us troubleshoot. Example 1 – WMI Script to List the Services Running on ComputerĪs promised, we are going to create a script to start or stop Windows services, but to begin with, I want to list merely the services. For example, here is a classic script to restart the remote registry service remotely. Therefore, the advantage of a WMI script is that it saves time and gives you the power of controlling other computers from the comfort of your chair. WMI and VBScripts just mimic what you could do manually. ![]() Key WMI words: Win32 Process Scenario for Starting and Stopping Services
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |