This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Issues using Windows Script Monitor with Windows 2008 R2 servers

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 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

  • This is very likely a permissions related issue as all vbscripts are executed locally on the Orion server under the local system account. I would recommend using PowerShell (local with impersonation) or remote PowerShell instead of vbscript to work around the improved security included in Windows 2008 and later versions of the Windows Operating System.

  • FormerMember
    0 FormerMember in reply to aLTeReGo

    Agreed, re-writing your VB scripts to PowerShell will not only benefit SAM execution, it will assist your automation needs as you leverage the .net object based logic.