Citrix Mfcom Programming For Administrators
-
Upload
vishalganeriwala -
Category
Technology
-
view
6.442 -
download
1
description
Transcript of Citrix Mfcom Programming For Administrators
Citrix MFCOM Programming for AdministratorsCitrix MFCOM Programming for Administrators
October 2007October 2007
2© 2007 Citrix Systems, Inc. — All rights reserved
100 Applications 1000 Users
100,000 Clicks
3© 2007 Citrix Systems, Inc. — All rights reserved
Introductions
Instructors
• Nitin Desai
• Vishal Ganeriwala
Facilitators
• Fred Liu
• Tom Kludy
• Jeff Reed
4© 2007 Citrix Systems, Inc. — All rights reserved
Agenda
MFCOM Basics
Start Using MFCOM
Labs In Action
Future And Takeaways
5© 2007 Citrix Systems, Inc. — All rights reserved
Agenda
Agenda item number 1
Start Using MFCOM
Labs In Action
Future And Takeaways
MFCOM Basics
6© 2007 Citrix Systems, Inc. — All rights reserved
What is MFCOM?
• COM-based management interface
• Runs on every Citrix Presentation Server™ box
• Scriptable and COM programming language support
• Remote execution
7© 2007 Citrix Systems, Inc. — All rights reserved
Work Smarter and Faster Using MFCOM
Integration with third-party software applications3
Information reporting2
Automate administration tasks1
8© 2007 Citrix Systems, Inc. — All rights reserved
How Does MFCOM Work ?
MFCOM
IMA
LHC
DCOM
RPCSAL
SALSAL
Data Store
Data Collector
Citrix Presentation Server
Windows Machine
SAL : Subsystem Access Layer
9© 2007 Citrix Systems, Inc. — All rights reserved
Common MFCOM Objects
Zones
Farm
Apps
Servers
Sessions
Policies
Servers
Users
Sessions
Apps
Processes
VCs
10© 2007 Citrix Systems, Inc. — All rights reserved
Agenda
Agenda item number 1
MFCOM Basics
Labs In Action
Future and Takeaways
Start Using MFCOM
11© 2007 Citrix Systems, Inc. — All rights reserved
DCOM
Port 2512
Today’s Setup For Class Demos
Client MachineMPS SDK
Lab1CPSCPS 4.5 VM
Lab2CPSCPS 4.5 VM
DCOM
IMAFarm Name: SDKDemo
Data Store: Lab1CPS
Zone Data Collector: Lab1CPS
Servers : Lab1CPS & Lab2CPS
12© 2007 Citrix Systems, Inc. — All rights reserved
How Can I Get Started?
• Download SDK from: http://support.citrix.com/page.jspa?pageID=devCenter
• Browse Script Repository http://support.citrix.com/kb/category.jspa?categoryID=645&subCategoryID=645
13© 2007 Citrix Systems, Inc. — All rights reserved
Setting Up Client and Server Machines
• Register the remote Citrix Presentation Server using: mfreg <servername>
• Use dcomcnfg to change the Impersonation level from identity to impersonate on Windows XP
• W2K3+SP1 CPS Server - Add remote MFCOM user to the DCOM Users Group
• Make sure you have administrative privileges for the Citrix Farm
14© 2007 Citrix Systems, Inc. — All rights reserved
SampleExamples
15© 2007 Citrix Systems, Inc. — All rights reserved
MPSSDK Documentation• MPSSDK Help System
• MFCOM browser • http://www.jasonconger.com/ShowPost.aspx?strID
=9686d808-19c0-4bad-a577-02d85f597a8d
16© 2007 Citrix Systems, Inc. — All rights reserved
Displaying Farm Name
• Use of VBScriptTemplate.wsf to add code
• Use of MetaFrameFarm Object and its methods
17© 2007 Citrix Systems, Inc. — All rights reserved
Navigating MFCOM …
• New version of interfaces with different releases• MetaFrameFarm object : IMetaFrameFarm6 (CPS4.0) inherits from
IMetaFrameFarm5 (CPS3.0)
• Scripts connect to the latest interfaces
• C++ - Use QueryInterface
• Drill down to appropriate level of object.• MetaFrameServer Object:
• IMetaFrameServer
• IMetaFrameWinServer
Finding the relevant interface
18© 2007 Citrix Systems, Inc. — All rights reserved
Agenda
Agenda item number 1
MFCOM Basics
Start Using MFCOM
Future And Takeaways
Labs In Action
19© 2007 Citrix Systems, Inc. — All rights reserved
What Will You Learn?
• When and how to use MFCOM
• Navigating the documentation
• Using major MFCOM objects
• Auditing the farm
• Automating Citrix Presentation Server™ management tasks
20© 2007 Citrix Systems, Inc. — All rights reserved
Labs: Commonly Done Presentation Server Administration Tasks
• Lab 1: Servers and Applications
• Lab 2: Create a Load Evaluator
• Lab 3: Take the Server Offline
• Extra Credit:• Printing
21© 2007 Citrix Systems, Inc. — All rights reserved
Auditing Using Enumerations
Zones
Farm
Apps
Servers
Sessions
Sessions
• Object associations as a powerful tool for auditing
22© 2007 Citrix Systems, Inc. — All rights reserved
Lab 1 : Servers and Applications
• List servers and applications in the Farm.
• List Applications on each server.
• List Servers for each application
• Use of MetaFrameServer and MetaFrameApplication methods/properties.
23© 2007 Citrix Systems, Inc. — All rights reserved
Simple Administration Tasks
• Creating new entities in the farm• Create an Object in MFCOM
• Initialize the necessary data
• SaveData – Saving data to IMA Datastore
• Changing the configuration settings for the existing entities• Create an Object (CreateObject method)
• Initialization – Initialize or set methods
• LoadData – Loading data from IMA Datastore
• Change the settings
• SaveData – Save data back to IMA Datastore
24© 2007 Citrix Systems, Inc. — All rights reserved
Lab2 : Create a Load Evaluator
• Create a Load Evaluator
• Set the name and description
• Create a LMRule for CPU utilization
• Create a LMRules collection and add a rule
• Set Load Evaluator Rules and save the data
• Use of MetaFrameLoadEvaluator, MetaFrameLMRule and MetaFrameLMRules methods/properties.
25© 2007 Citrix Systems, Inc. — All rights reserved
Inside MFCOM
• COM Free threading model
• Error reporting• Limited error codes as HRESULT
• Exceptions in. NET
• MFCOM user• Current user vs. other user (runas)
• MFCOM impersonates before calling IMA
26© 2007 Citrix Systems, Inc. — All rights reserved
Complex Management Tasks
• Connecting more than one entity in the farm
• Series of tasks with proper ordering
• Repetitive pattern
• Examples• Take the server offline
• Migrate applications from one farm to another
• Remove the server from N applications
27© 2007 Citrix Systems, Inc. — All rights reserved
Lab3 : Taking The Server Offline
• How to take the server offline for maintenance purpose gracefully?
• Steps - 1. Prevent the new connections
2. Communicate to the users
3. Let the connections drain
4. Logoff the sessions after timeout period
• Use of MetaFrameLoadEvaluator, MetaFrameSession and MetaFrameServer methods/properties.
28© 2007 Citrix Systems, Inc. — All rights reserved
Advanced MFCOM Usage
• Multi farm management• Create objects on the multiple remote servers
• C# - Activator method
• VBScript - CreateObject(("MetaFrameCOM.MetaFrameFarm", ServerName1)
• Event handling• Server, Application and Folder Events
• Create, update (rename), move and delete
• MetaFrameFarmEvent enum, IMetaFrameEventQueue, CreateEventQueue2 method in MetaFrameFarm
29© 2007 Citrix Systems, Inc. — All rights reserved
Extra Credit : Printing
• List printer drivers on every server
• Use of MetaFrameServer and MetaFramePrinterDriver Methods
30© 2007 Citrix Systems, Inc. — All rights reserved
Agenda
Agenda item number 1
MFCOM Basics
Start Using MFCOM
Labs In Action
Future and Takeaways
31© 2007 Citrix Systems, Inc. — All rights reserved
CPSSDK
• Scalability • Highly scalable in large farm environment
• Usability• Consolidation of interfaces and methods
• Enhanced consistency in object behavior
• Easy multi-farm management
• Better .Net Support• .NET assembly
• .NET versioning and generics
Next-generation Presentation Server Management SDK
32© 2007 Citrix Systems, Inc. — All rights reserved
How Does CPSSDK Work ?
IMACOM
IMA
LHC
DCOM
RPCSAL
SALSAL
Data Store
Data Collector
Citrix Presentation Server
Windows Machine
CPSSDKCPSSDKClientClient
Cached Cached DataData
Chunky Chunky CallsCalls
SAL : Subsystem Access Layer
33© 2007 Citrix Systems, Inc. — All rights reserved
Work Smarter and Faster
Start Using MFCOM Today!
34© 2007 Citrix Systems, Inc. — All rights reserved
Before you leave…
• Overall conference survey is available online at www.citrixiforum.com starting Wednesday, October 24 (please provide feedback)
• Download workshop materials from www.citrixiforum.com starting Monday, October 29
• Leftover workshops handouts can be found at the HOT Assistance Center Desk
35© 2007 Citrix Systems, Inc. — All rights reserved
36© 2007 Citrix Systems, Inc. — All rights reserved
Data Type: LMRuleSchedule
Bit 31-16 Bit 15-0
End time Start time
Bit 15-8 Bit 7-5 Bit 4 Bit 3-0
Hour (in military time format) Not used Half hour
Day of week