How to Get Started with MFCOM Script

Added by Vishal Ganeriwala , last edited by Vishal Ganeriwala on Oct 08, 2007  (view change)
Tags: 
(None)

Summary

This document describes how to get started with MFCOM.

Procedure

  1. Download and install MFCOM SDK from the Citrix Web site.
  2. Register the Remote or Local server using Mfreg.exe.
    After installing MFCOM SDK, type Mfreg at the command prompt. You should see following window which explains how to register or unregister your server.

  1. Type MFreg<ServerName> to register the server name.
  1. Setting up script environment:
  1. Set the script host engine to cscript as the default engine. By doing this, you will not need to type "cscript <filename>.wsf" to run the application. All that is needed is the application name, <filename>.wsf.
  2. Enter cscript//h:cscript at the command prompt.

  1. Setup the script skeleton. Copy and paste the following code section to a text editor.

Code:

<package>

    <job id="">


       <comment>


        File:

        Description:

        Requirements:


        </comment>

        <runtime>

            <description>

            </description>

            <example>

            </example>

        </runtime>

        <reference object="MetaFrameCOM.MetaFrameFarm"/>

        <script language="VBScript">


            </script>

    </job>

</package>


	Run my MFCOM script. You can now insert you code between script tag.  Insert the following code:




<script language="VBScript">


Dim theFarm

Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")

theFarm.Initialize(MetaFrameWinFarmObject)

WScript.Echo "MetaFrame Farm Name: " &  theFarm.FarmName


</script>


  1. Save the file as farm.wsf . At the command prompt issue following command:

farm.wsf

You should see the farm name of the environment.