?
Solved

VBScript and Windows Clustering

Posted on 2007-04-02
1
Medium Priority
?
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
jwarnken earned 1500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
#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.
Suggested Courses

777 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