• System Center 2012 Orchestrator–RunBook Activities

    In this second part of Orchestrator RunBook Concepts series, we’ll cover RunBook activities and its properties.

    Part 1: http://blogs.technet.com/b/meamcs/archive/2012/03/06/system-center-2012-orchestrator-runbook-basics.aspx

    Part 3: http://blogs.technet.com/b/meamcs/archive/2012/03/14/system-center-orchestrator-2012-test-amp-start-runbooks.aspx

    Part 4: http://blogs.technet.com/b/meamcs/archive/2012/04/09/system-center-2012-orchestrator-link-conditions.aspx

    In the System Center 2012 Orchestrator , activities are the building blocks of RunBooks. In general, individual activities perform three actions:


    - Access Published Data.
    - Perform some action.
    - Publish new data.

    By default installation, Orchestrator has following activity collections.

    image

    Each collection includes custom activities.

    image

    Other that Orchestrator provides you to extend standard activities with;

    • Integration Packs
    • Orchestrator Integration Toolkit

    IP’s are Microsoft or third-party products that contain additional activities for a specific technology. For example Service Manager 2012, Configuration Manager 2012 or HP.

    If required functionality is not available in an IP, then you can use OIK to build custom activity. Orchestrator CodepPlex page http://orchestrator.codeplex.com/ includes custom integration packs that was built with OIK.

    We’ll cover about how you can import an IP or how you can create your own IP with OIK in the next posts in this series.

    Now lets look at the properties of an activity.

    GENERAL:

    image

    General tab allows you to set a custom name and description for each activity.

    Published Data:

    image

    Orchestrator lets you to get data from published data items and convert them into a usable form. For example you can read a text file line by line and publish each line text to the other activities or RunBooks.

    image

    For the above example, I used Read Line activity to read each line in a text file. Next activity is responsible to start/stop specific services on remote machines.

    Now open Start/Stop Services activity details tab;

    image

    image

    By default read line activity publishes above data into the Orchestrator Databus.

    In Start/Stop Service activity if you right click any field and click Subscribe, each published data for previously linked activities will be shown up. “Line text” is what I want exactly to get right computer names to start/stop relevant service.

    Same process also can be used for .Net Script activity.

    image

    By default .Net Script activity does not publish any data into the Orchestrator Databus. But you can optionally publish each PowerShell variable with a few clicks.

    image

    $explorerprocess = Get-Process | where {$_.name -like "iexplore"} | select ID

    command gets all processes that name column includes “iexplore” string and then pipe out only ID information. I assigned each ID’s to a variable called $explorerprocess. This is not a useful or well designed script but our purpose is to show how to publish variables within a PowerShell scripts to the Orchestrator Databus.

    Now I can define this variable as a Published Data in Run .Net Script activity.

    image

    Simply give a name and enter your exact variable name. I used same for both field as you see.

    image

    Now open Append Line Activity details.

    image

    You can now use previously Published variable.

    image

    image

    If you run your Runbook it will get all Explorer process id’s and append them in to the text file line by line.

    image

    Of course you can modify your PowerShell script to get better looking outputs Smile

    Published Data Behavior:

    This tab contains the properties that determine how the activity handles multi-value Published Data.

    image

    image

    If we would configure Run behavior as “Separate With ,” for the previous example, we would have below output.

    image

    Security Credentials.

    This tab allows you to specify other accounts than RunBook Server Service account. This helps you when activity performs actions on remote computers.

    image

    Next part we’ll cover how to run or test your RunBooks.

    Thanks.

  • System Center Orchestrator 2012 – Test & Start RunBooks

    In this part of Orchestrator 2012 RunBook Concepts series, let’s cover how to test, save and run your existing RunBooks.

    For the first two parts:

    Part 1: http://blogs.technet.com/b/meamcs/archive/2012/03/06/system-center-2012-orchestrator-runbook-basics.aspx

    Part 2: http://blogs.technet.com/b/meamcs/archive/2012/03/09/system-center-2012-orchestrator-runbook-activities.aspx

    Part 4: http://blogs.technet.com/b/meamcs/archive/2012/04/09/system-center-2012-orchestrator-link-conditions.aspx

    In RunBook Designer console, on the top bar you’ll notice three button:

    image

    Check Out: To be able to edit an existing RunBook, it must be checked out. Main purpose for that action is to prevent concurrent editing of same RunBook by different users.

    image

    If someone else is already editing RunBook, you will notice a pop-up window informing that someone is already editing RunBook.

    Check In:After you finish your editing, you can Check In RunBook and so that all your changes will be committed. And also other users can then edit RunBook.

    Undo Check Out: If you click Undo Check Out button when editing the RunBook, all changes you made are reverted.

    Testing RunBooks

    Before you run Runbooks, you can test it with RunBook Tester and also easily debug each activity or entire RunBook. This is especially helpful for troubleshooting issues. But don’t be confused about terms, RunBook Tester will apply each activity changes to your current environment, that means it will not use a demo or isolated env.

    Please also note that tester runs in the currently logged user context. Orchestrator Service account will not be used for testing purposes. So it would be better to open RunBook Tester as Administrator with high-level security token.

    image

    When you click RunBook Tester from the toolbar, Tester starts and loads relevant RunBook

    image

    RunBook tester interface consists of five panes;

    Run Time Properties:This is one of the mostly used pane. It displays resolved published data items. It’s important because if you use several published items for activities, you may want to see what data is carried between activities. Best way to see them in a clear way is RunBook Tester.

    Design Time Properties: Displays design-time information for each activity. This is same with Activity details page.

    image

    Workspace: Displays active current Runbook. You can set a breakpoint for each activity.

    image

    Breakpoint will be marked with a red round on activity and tester will stop on it.

    Log: Displays detailed information for each activity.

    image

    You can expand each entry to show details.

    image

    Resource Browser: Displays the counters, variables, computer groups and schedules.

    image

    You can predefine each of them and make available for all RunBooks.

    Computers Groups and global items can be added within Connections Node.

    image

    Lets add a computer set to use it within activities.

    image

    image

    Now you can use Computer Group within an activity;

    image

    image

    image

    This activity will be performed for all computers which members of previously created Computer Group.

    Starting Test

    You can start your test with different options;

    image

    Step Through: Runbook starts with first activity and after completion, it waits for your input. You can click Step button to move one step forward. So you can view design time properties for each activity easily.

    image

    Waits for my next click..

    Starting RunBooks

    To start a RunBook, firstly you must click Check In button to commit changes. Then just navigate related Runbook tab and click Run.

    image

    To stop, just click Stop button on the Toolbar. You can track activity’s success&failure progress on Log Pane;

    image

    All related events will be logged under Events Pane;

    image

    Also to track RunBook changes, In the RunBook Designer, select Audit History tab at the bottom and click individual items.

    image

    image

    This is important if there are multiple Runbook designer users in your environment. You can track each Runbook change easily within Audit History.

    Next part we’ll cover how to design basic and complex Runbooks.

  • Walkthrough SharePoint 2010 Workflow Visualization

    Introduction

    SharePoint 2010 is a powerful platform that provides many useful features that help us in our day to day activities. As I was working in one of the projects I came along a challenge of implementing out of the box workflows, so I considered to explore the option of using one of the new features in SharePoint 2010 called Workflow Visualization.

    Workflow Visualization in SharePoint 2010 (Using Microsoft Visio 2010)

    Workflow Visualization utilizes SharePoint 2010 capabilities with the power of Microsoft Visio 2010 as an authoring tool. To activate this feature you must use the following:

    • Microsoft SharePoint 2010 with SharePoint Designer
    • Microsoft Visio 2010 Premium Edition (and activate Visio Services on SharePoint)
    • Silverlight 3.0

    Usage Scenario

    You can use Microsoft Visio 2010 (Premium Edition) to create all kinds of sequential workflows (state machine workflows are not supported yet), all you have to do is:

    1.     Create a New Visio Workflow

    • Launch Visio, and then click on the File tab.
    • Click on the Flowchart Template Category, and then click on Microsoft SharePoint Workflow to start authoring a SharePoint workflow.

     

     

    2.     Authoring Your Workflow

    There are three stencils available for SharePoint Workflow:

    • SharePoint Workflow Actions
    • SharePoint Workflow Conditions
    • SharePoint Workflow Terminators

    Use the above to create your own workflow

    3.     Validate Your Workflow

    The next step is validation your workflow so that we are able to successfully export it  to SharePoint 2010. To validate the workflow, users can click on the Process tab, and click on the Check Diagram button.

    In the event that your workflow has issues, an Issues window will pop up, and the shape having the issue will be highlighted.

    Note:

    There are rules that you need to consider during the validation of the workflow, for more info go to:

    http://visio.microsoft.com/en-us/Get_Started/WhitePapers/Pages/SharePoint-Workflow-Authoring-in-Visio-Premium-2010.aspx

    4.     Exporting Your Workflow to SharePoint Designer 2010

    To export, simply go to the Process tab and click Export:

    Visio will automatically validate the workflow first to make sure the workflow can be exported and consumed by SharePoint Designer.

    Note:

    You can also import the workflow using SharePoint 2010 designer Import option shown below:

     

    5.     Test Your Workflow using Visualization in SharePoint with Visio Services

    To do so, go to the Workflow Summary page, and check the “Show workflow visualization on status page” box (note that the checkbox is only available if the SharePoint server has Visio Services enabled and if Visio Premium 2010 is installed in the same machine as SharePoint Designer 2010):

    As a result, the workflow is not only being executed, but users can easily track progress of the workflow through visualization! For example, in the diagram below, there are icons indicating tasks “in progress” or “completed”. People assigned to the tasks are also displayed clearly within the Task shapes:

    This is made possible by Visio Services, which enables viewing of Visio Web Drawings on SharePoint without requiring the Visio client to be installed for viewing.

     Additional Information:

    This post used the “SharePoint Workflow Authoring in Visio Premium 2010” document as the primary source of information, you can find it under:

    http://visio.microsoft.com/en-us/Get_Started/WhitePapers/Pages/SharePoint-Workflow-Authoring-in-Visio-Premium-2010.aspx

     

     

  • InfoPath with Document Information Panels (DIP) in SharePoint 2010 Document library

    The document information panel DIP is a form that appears within Microsoft office documents, it can be used with documents hosted with SharePoint libraries, it allows the users entering data that can be saved later to SharePoint libraries columns and can be modified to have validation and external data retrieval using web services , in this post we will create custom document information panels using Microsoft InfoPath 2010 that collect data from user and stores it in document library metadata we will modify the look and feel for the DIP to include organization name and logo, this post is related to the main post of InfoPath Forms Options in SharePoint 2010

    By customizing the Document Information Panel, you can add business logic, such as data validation, or add custom properties. In addition, by creating a template part to contain common fields, you can organize the efficient reuse of Document Information Panels in different Office release document types.

    As start to display document information panel, from the file menu in office document show information panel as follows

    clip_image002

    Document information panel getting displayed as follows

    clip_image004

    Now to customize document information panel, open info path from the file menu design form

    clip_image006

    Enter the SharePoint library URL that will host the documents with DIP

    clip_image008

    select the content type in library that will have the DIP

    clip_image010

    now you can modify the design of the DIP using InfoPath , In this example Ill play with the styles and include sample Icon and add subject filed to clarify the idea

    clip_image012

    Now to publish the changes

    clip_image014

    now if you open the documents hosted on SharePoint library you can find the modified DIP as shown in figure below

    clip_image016

    The following figure shows how document property values are assigned and stored, both in the document itself and in the document library. In this example, the content type for the document includes the Title column, which is mapped to the Title core document property. In addition, if content type for example includes two other columns, Property A and Property B. Values for these properties are stored in the document in the customXml section, in the properties data store item. Changing values in the document information panel updates the values in the document itself; these new values are promoted to the document library when the document is next saved back to the library. Similarly, when you change the column value on the document library, the new column value is demoted into the document as the appropriate document property when the document is next downloaded, more information can be found at Document Information Panel and Document Properties in SharePoint Server 2010 (ECM)

    clip_image018

  • How to Convert Web Site To Web Application

     

    In earlier post, I have explained the motives behind converting web site (WSP) to web application (WAP). In this post I will detail the steps of conversion.

    Before talking about steps, it is important to mention that, steps listed below are for a web site that is located in Team Foundation Server (TFS) 2010 repository. So, when converting, we need to make sure, the source history is also carried out.

    Preparation on current WSP:

    1. Make a conversion plan and Inform your team members.
    2. Clean-Up: Remove all garbage stuff in WSP, if any.
    3. Services: Add service references from service location.

    Steps for conversion:

    1. Create a branch from the team project your WSP located in. I named it ‘TP2’ here for reference purposes.
    2. Create a web project and solution named. I  named it ‘WAP.Web’ for reference purposes.
    3. Add a new class library project called WAP.Web.Library.
    4. Add a new folder called "Assemblies" into root level, then add a new folder called "3rdParties" here. Add all 3rd party references into 3rdParties folder, all other dll referenced by the project here.
    5. Run tfs command, "tf move $/TP2/Old_WebSiteCode/* $/TP2/WAP.Web/WAP.Web to move files into new project along with their history.
    6. Run tfs command, "tf move $/TP2/WAP.Web/WAP.Web/App_Code/* $/TP2/WAP.Web/WAP.Web.Library" to move files into new project along with their history. It is a good practice to place all the files located in App_Code folder in WSP into a class library project.
    7. Build WAP.Web.Library
                      1- Include all folders into the project.
                      2- Add references from dlls in Assemblies and/or 3rdParties folders.
                      3- Add web references by giving service locations for each service used in the application.
                      4- start fixing error one by one till built succeeded.
      8- Build WAP.Web:
                      1- Include all folders into the project.
                      2- Add references from dlls in Assemblies and/or 3rdParties folders. Build it, make sure you have errors only related to "missing …designer.cs files".
                      3- Run "Convert to Web Application" from VS 2010         
                      4- Start fixing error one by one till built succeeded.

    Once, it is all good, you may strengthen more your project structure by adding namespaces in CodeBehind files.

    Conclusion

    The most common issues in converting web site to web applications are missing assembly references, missing namespaces, incorrect @CodeBehind directives on .aspx and .ascx files.

    References

    1. Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio