Solved

VBScript and Windows Clustering

Posted on 2007-04-02
1
590 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now