Summary
This document describes how to start writing Health Monitoring & Recovery tests using MFCOM and VBScript.
Procedure
- Download and install an MFCOM SDK from the Citrix Web site. Use CTX106305 - [entryID]CTX106305[/entryID] as a reference for installing MFCOM.
- Create a new .wsf file and add the following XML as the skeleton of your script:
<package>
<job id="Farm">
<comment>
File: x.wsf
Description: File description.
</comment>
<runtime>
<description>
A simple test script
</description>
</runtime>
<reference object="MetaFrameCOM.MetaFrameFarm" /> <script>
Your script here.
</script>
</job>
</package>
If you use this skeleton code for your script, you do not have to add any other code for VBscript - you are already up and running. At this point you can choose a different scripting language like jscript.
Also, the reference tag highlighted above instructs the scripting engine to use the MFCOM object. This also imports other MFCOM constants needed to write scripts. Even though the reference is to a specific object, MetaFrameCOM.MetaFrameFarm , this object references any MFCOM objects in your script [Scripting MetaFrame , Dr. SDK].
- Open the MFCOM help to view all MFCOM objects.
- To create one of the top level objects (objects with names starting with MetaFrame (for example, MetaFrameServer object), add this line:
Set mfServer = CreateObject("MetaFrameCOM.MetaFrameServer")
Where MetaFrameCOM.MetaFrameServer is the object identifier of the MFCOM object that was installed on your system when you installed MFCOM.
- To use all the properties and methods of the object, initialize it:
mfServer.Initialize MetaFrameWinServerObject, servername
The initialization signature for each object is different, but they all take a value indicating what object you are initializing. Think of this as connecting your object with the entity in the farm that really exists [Scripting MetaFrame , Dr. SDK].
You can now use this object programmatically any way you would like.
Disclaimer
These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.