Solved

VBScript and Windows Clustering

Posted on 2007-04-02
1
595 Views
Last Modified: 2008-01-09
I have a Windows Clustering question.  We have a software application that isn't cluster aware.  All services are running on a mapped SAN drive E:.  When a connection is lost on Production, the E: drive is mapped to the failover, and services go up.  We have a situation where a file needs to be copied from one directory to another before the services are started.  I have written a VBS file to copy the files, but can not figure out how to configure the clustering software to kick off a VBS file.  Any help would be greatly appreciated.  Currently, the cluster group is the E: drive..no aliases to the services.  

I would really like to Map the E: drive, copy the file, then start the services.
VBS file:
Dim objNet
Dim objFSO, objFileCopy, objGuyFile
Dim strFilePath, strDestination

strFilePathprod = "E:\inserver6\etc\node_id_CHWINCL2A\in_hwfp"
strFilePathfail = "E:\inserver6\etc\node_id_CHWINCL2B\in_hwfp"
strDestination ="E:\inserver6\etc\in_hwpf"


Set objNet = CreateObject("WScript.NetWork")
Set FileSystemObject = CreateObject("Scripting.FileSystemObject") 'Create a filesystem
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives 'Create a drives collection
Set objFileCopy = objFSO.GetFile(strFilePathprod)
Set objFileCopy2 = objFSO.GetFile(strFilePathfail)
For Each DiskDrive in Drives
DriveLetter = DiskDrive.DriveLetter
if DriveLetter = "E" then
    mydrive = DriveLetter
end if
Next

Dim strInfo
strInfo = objNet.ComputerName
if strinfo = "CHWINCL2A" and mydrive = "E" then
   
   ' Copy the file to its destination
   objFileCopy.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
else
   ' Copy the file to its destination
   objFileCopy2.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
end if
      
Set objNet = Nothing                    'Destroy the Object to free the Memo

0
Comment
Question by:ntiguy
1 Comment
 
LVL 8

Accepted Solution

by:
jwarnken earned 500 total points
ID: 18862030
I do not work with clustering and am taking a stab in the dark based on http://msdn2.microsoft.com/en-us/library/ms952401.aspx 
But it seams that the command line could be modified to launch your script (i.e. cscript clusterfix.vbs)
You would then have to add the command live for your app into your script as well

Sounds simplet but I am sure there are some important considerations that you are aware of being that you work with it more.

Good luck
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question