Quantcast
Channel: THWACK: All Content - Server & Application Monitor
Viewing all articles
Browse latest Browse all 12281

Issues using Windows Script Monitor with Windows 2008 R2 servers

$
0
0

Hello all,

 

Has anyone had issues using the Windows Script component to run VBScripts to a Windows 2008 R2 server.

 

We use many of these monitors in our environment on our older 2003 servers and we are making the push to 2008 and now I am not able to get these scripts to work properly.

 

I used the following sample script provided in the Orion install: (FileFind.vbs)

 

' Copyright © 1999-2008 SolarWinds, Inc. All Rights Reserved.

'

' Script Name: FileCount.vbs

' Purpose: This script will return the number of files in a folder.

' Usage: cscript.exe  FileCount.vbs [pathToFiles]

' [pathToFiles] is Local or UNC Path

 

Option Explicit

On Error Resume Next

 

Dim lstArgs, path, fso, objDir, objFiles

Set lstArgs = WScript.Arguments

 

  If lstArgs.Count = 1 Then

     path       = Trim( lstArgs( 0 ))

  Else

     WScript.Echo "Message: Usage: wscript.exe filelist.vbs [pathToFiles]" &vbCRLF &"[pathToFiles] Local or UNC Path"

     WScript.Echo "Statistic: 0"

     WScript.Quit( 1 )

  End If

 

  Set fso  = Wscript.CreateObject( "Scripting.FileSystemObject" )

 

  If fso.FolderExists( path ) Then

    Set objDir   = fso.GetFolder( path )

 

    If( IsEmpty( objDir ) = True ) Then

      WScript.Echo "Message: OBJECT NOT INITIALIZED"

      WScript.Echo "Statistic: 0"

      WScript.Quit( 1 )

    End If

   

    Set objFiles = objDir.Files

    

    If( IsEmpty( objFiles ) = True ) Then

      WScript.Echo "Message: OBJECT NOT INITIALIZED"

      WScript.Echo "Statistic: 0"

      WScript.Quit( 1 )

    End If

 

    WScript.Echo "Message: " & CInt( objFiles.Count ) & " FILES"

    WScript.Echo "Statistic: " & CInt( objFiles.Count )

    WScript.Quit( 0 )

   

  Else

    WScript.Echo( "Message: FOLDER NOT FOUND" )

    WScript.Echo "Statistic: 0"

    WScript.Quit( 1 )

  End If

 

This works great on my 2003 servers and returns the expected results with no issues. When I test this on my 2008 R2 servers I get a 'Path not found' error....

 

I looked at my accounts and permissions and everything looks good...the account attempting to execute the script is a Domain Admin account and is on both servers locally as well.

 

Thanks,

B


Viewing all articles
Browse latest Browse all 12281

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>