Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
On Error Resume Next
'Set the report output directory (end with a backslash)
dir = "D:\SqlServicesAnalysis\"
'Set the text report file name
filename = "SQLServicesStatus.txt"
'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'open the data file
Set oTextStream = oFSO.OpenTextFile("D:\SqlServicesAnalysis\LISTSqlServers.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
For Each strComputer In RemotePC
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colRunningServices
If InStr(UCase(objService.DisplayName), "SQL") > 0 Then
Report = Report & vbCrLf & "Computer ," & strComputer & ", reports service ," & objService.DisplayName & ", is ," & objService.State
End If
Next
set colRunningServices = Nothing
set objWMIService = Nothing
Next
If Not oFSO.FolderExists(dir) Then
oFSO.CreateFolder(dir)
End If
Set ts = oFSO.CreateTextFile (dir & filename, True)
ts.write report
Main = DTSTaskExecResult_Success
End Function