VbScript ::: need help

Author Message
hjafary

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 10/14/2011
  • Status: offline
VbScript ::: need help Friday, October 14, 2011 10:37 AM (permalink)
0
Dear people,
i am new in vbscripting and i wanna realize three scripts for:
1. making a list from services running on the servers in Servers.txt
2. making a list of the shares available on the servers in Servers.txt
3. making a list of ip-address of the servers in Servers.txt
Can anyone help me out of this problem?... thanks for your help.
Regards, Hamid
--------------
For the services i have found a script but i can not make it so that it uses the Servers.txt[/style] file instead of the local computer. any help is appreciated.
strComputer = "."
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("c:\scripts\service_list.csv", _
ForAppending, True)
objLogFile.Write _
("System Name,Service Name,Service Type,Service State, Exit " _
& "Code,Process ID,Can Be Paused,Can Be Stopped,Caption," _
& "Description,Can Interact with Desktop,Display Name,Error " _
& "Control, Executable Path Name,Service Started," _
& "Start Mode,Account Name ")
objLogFile.Writeline

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service")

For Each objService in colRunningServices
Wscript.Echo objService.DisplayName  & VbTab & objService.State & VbTab & objService.Startmode
Next
<message edited by hjafary on Friday, October 14, 2011 10:54 AM>
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9