Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

VB Runtime error in Windows 2008R2

$
0
0
Please help!
We have number of .bat and VB scripts for monitoring SQL servers. The scripts are running fine on all previous Windows versions. Now we migrated one of the servers to Window 2008 R2 and a VB script is getting “Microsoft VBScript Runtime Error: Permission Denied”. I’m getting it on the line ‘oCluster.Open ComputerName’. I logged in to the box with my domain account which is a member of the local admin group. Does anybody know how to fix this issue? Where should I set permissions in Win 2008R2?

Many thanks in advance!

#######################################
Option Explicit
' Declare the constants and variables. Setting ComputerName
' to an empty string prompts the script to connect to the
' local computer.
Const ComputerName = ""
Const ForWriting = 2
Const StateFile = "c:\UsrBin\Server_Checks\clusterstate.log"
Dim oFs, f, oCluster, res, resGroup

' Set the FileSystemObject object.
Set oFs = CreateObject("Scripting.FileSystemObject")
' Create a new text file to store the ownership information.
Set f = oFs.CreateTextFile(StateFile,ForWriting)

' Set the Cluster Automation Server object.
Set oCluster = CreateObject("MSCluster.Cluster")

' Open a connection to the cluster node.
oCluster.Open ComputerName

' For each resource in the cluster node, get each resource
' group's resources.
For Each res in oCluster.Nodes
' For each resource group, get the name and the owner. Write
' this information to the text file.
For Each resGroup in res.ResourceGroups
f.writeline resGroup.name & "," & resGroup.OwnerNode.Name
Next
Next

' Close the text file.
f.Close

' Release memory.
Set oCluster = nothing
Set f = nothing
Set oFs = nothing
######################################

Viewing all articles
Browse latest Browse all 688

Trending Articles



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