List Services using WMI provider

Script to list Services and specific properties and values using WMI.

Contributed by
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
November 17, 2002
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

List Services in WMI



Script to list Services and specific properties and values using WMI.

Set fso = CreateObject("Scripting.FileSystemObject")

if fso.FileExists("c:testfile.txt") Then
set f = fso.GetFile("c:testfile.txt")
f.delete
End If

strComputer = InputBox("Enter Computer name", "Enter Name Here", "dc1.bgeek.com")

Set wbemServices = GetObject("winmgmts:\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_Service")
Set f = fso.CreatetextFile("c:testfile.txt", ForAppending, True)

For Each wbemObject In wbemObjectSet
f.write "Display Name: " & wbemObject.DisplayName & VBCrLf
f.write "State: " & wbemObject.State & VBCrLf
f.write "Start Mode: " & wbemObject.StartMode & VBCrLf
Next

set wbemServices = nothing
set wbemObjectset = nothing
set fso = nothing
set f = nothing
msgbox "Done!"
blog comments powered by Disqus
CODE EXAMPLES ARTICLES

- Bipartite Graphs
- Connectivity in Graphs
- The Ford-Fulkerson Algorithm
- Critical Paths
- The Bellman-Ford and Roy-Floyd Algorithms
- Shortest Path Algorithms in Graphs
- Minimum Spanning Tree
- Articulation Edges and Vertexes
- Circles and Connectivity in Graphs
- Depth-First Search in Graphs
- Breadth-First Search in Graphs
- The Prufer Code and the Floyd-Warshall Algor...
- An Insight into Graphs
- Coding a Custom Object with WSC
- Creating a Custom Object with WSC

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials