GD Bloggers

This is the blog site for Microsoft Global Delivery Communities focused in sharing the technical knowledge about devices, apps and cloud.
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

May, 2014

  • ITPro: How to Convert your Surface RT to Surface Pro – Part 3

    In Part 1: I’ve explained how to install Remote Desktop services on the server and fix common error that you may face, in Part 2 we finished configuring Remote Desktop Services and publish RemoteApp.
    This part we will test from client side machine by browsing to the RDWA and will configure Surface with RemoteApp.
     
    The following steps show how to test the connection to the Remote Desktop Web Access and test RemoteApp from browser:

    1.     Test Client Access: first test to make sure that the configuration is working is to test through browser:

    a.     From the browser open the URL points to your server, in my scenario this is: https://ts.meamcs.com/rdweb

    clip_image002
     

    b.     You will see all the published programs:

    clip_image004
     

    c. For testing open any of the programs, you will get prompted that the website is trying to run a RemoteApp program, as the following snapshot, click Connect.

    d. When prompting for credential, enter the user name and password, also notice that the connection is with the new name configured earlier:

    clip_image005
     

    e.     Now we have Active Directory Module for PowerShell is working and the marked cmdlet from Active Directory Module for PowerShell:

    clip_image007
     
    Now is the time to configure our Surface RT with RemoteApp:
    Configure RemoteApp on Surface:

    1.     From the Start Menu > open Remote Desktop application.

    2.     Either click on Access RemoteApp and Desktop Connection or from Settings charm click on Manage RemoteApp and desktops.

    clip_image009
     

    3.     Click Add New Connection, then enter the URL for your server https://URL/rdweb/feed/webfeed.aspx and click Connect.

    clip_image011
     

    4.     When prompt for credential put the username and password:

    clip_image013
     

    5. Now your Surface is connecting to the server running RemoteApp and retrieving all the programs:

    clip_image015
     

    6.     Click OK after retrieving the list of programs:

    clip_image017
     

    7.     This is the list of the available programs which now appears also in the start menu:

    clip_image019
     

    8.     From the list of programs or from the start menu let’s start PowerShell ISE:

    clip_image021
     

    9.     As you can see we have PowerShell ISE running with Windows Azure AD (Set-MsolUser is Office 365 cmdlet) and with Azure module (Add-AzureAccount is Windows Azure cmdlet).

     
    Now I’m enjoying Surface RT with all programs that I need, and this blog has been uploaded using Live Writer from my Surface RT (or is it Pro now J)
     
     
    Links to All Parts:
    Part 1: Install Remote Desktop Services
    Part 2: Configure RemoteApp
    Part 3: Configure Surface
  • ITPro: How to Convert your Surface RT to Surface Pro – Part 1

     

    From long time I’ve started to have all my labs on Windows Azure (will share that experience in another blog), my main motive was to get rid of my heavy ugly laptop to a light and thin one. My first pilot was to use Surface as the replacement of my laptop.
     
    For some reason (I don’t remember it now) I’ve decided to get Surface RT not Surface Pro, I’m trying to convince myself now that RT lighter, RT is 676 grams compared to 907 grams for the Pro.
     
    But anyway here it is my RT device, I loved the experience and the display but the second day I looked for PowerShell ISE and couldn’t find it, PowerShell ISE was my magical solution to connect to Office 365 so it’s mandatory for me. The result: PowerShell ISE is not built in with Windows RT and can’t be installed from the store.
    Ok no ISE let’s install the PowerShell Module for Azure (Windows Azure VMs cmdlets) and PowerShell Module Windows Azure AD (Office 365 module), obviously you can’t install anything to RT.
     
    The huge one when I started to look for Visio and Project Pro, and yes both are not part of Office pro which installed on the Surface and are not available on the Store. Now it’s serious I can’t work without these programs.
     
    I started to look for a solution and first thing came to my mind is to RDP to another machine running on Azure that have everything I need, nice Idea and worked fine but annoying as you need to share the files (copy it or send it by email) between the 2 PCs, didn’t like the overall experience.  
    I was reading some of the new staff on Windows 2012 when I thought of RemoteAPP, what if I’ve a server on Azure running Remote App and I can use all my applications.
     
    First things first, what is RemoteApp:
    RemoteApp programs are programs that are accessed remotely through Terminal Services and appear as if they are running on the end user's local computer. Instead of being presented to the user in the desktop of the remote terminal server, the RemoteApp program is integrated with the client's desktop, running in its own resizable window with its own entry in the taskbar. Users can run RemoteApp programs side-by-side with their local programs. If a user is running more than one RemoteApp program on the same terminal server, the RemoteApp programs will share the same Terminal Services session.
     
    In simple words I will have Visio installed on the server in Azure, on my Surface when I click for Visio, I will open RDP session in the background which will run Visio on the server and present it in my Surface RT as if it is installed locally, that is the magic solution that I was looking for.
     
    Users can access RemoteApp programs in several ways. They can:

    1. Access a link to the program on a Web site by using TS Web Access.

    2. Double-click a Remote Desktop Protocol (.rdp) file that has been created and distributed by their administrator.

    3. Double-click a program icon on their desktop or Start menu that has been created and distributed by their administrator with a Windows Installer (.msi) package.

    4. Double-click a file where the file name extension is associated with a RemoteApp program. This can be configured by their administrator with a Windows Installer package

     
    I always go for the easiest solution so of course number 3 is my choice the programs will be on my Start menu as they are installed on my Surface.
     
    My target with this article is the ITPro, if you are with MSDN subscription you can activate your free hours on Windows Azure, check this for the details:
     
    In my lab on Azure I’ve decided to use one of my servers as the RemoteAPP server.
     
    To have the RemoteApp we will need the following components (logical as roles not physical as number of servers):

    1.  RD Session Host: Remote Desktop Session Host (RD Session Host), formerly Terminal Server, enables a server to host Windows-based programs or the full Windows desktop. Users can connect to an RD Session Host server to run programs, to save files, and to use network resources on that server.

    2.   RD Web Access: Remote Desktop Web Access (RD Web Access), formerly TS Web Access, enables users to access RemoteApp and Desktop Connection through the Start menu on a computer that is running Windows 7 or through a Web browser. RemoteApp and Desktop Connection provides a customized view of RemoteApp programs and virtual desktops to users.

    When a user starts a RemoteApp program, a Remote Desktop Services session is started on the RD Session Host server that hosts the RemoteApp program.

    3.  RD Connection Broker [Optional]: The RD Connection Broker database stores session state information that includes session IDs, their associated user names, and the name of the server where each session resides. When a user with an existing session connects to an RD Session Host server in the load-balanced farm, RD Connection Broker redirects the user to the RD Session Host server where their session exists. This prevents the user from being connected to a different server in the farm and starting a new session.

    RD Connection Broker is also used to provide users with access to RemoteApp and Desktop Connection.

    4.   DC: of course a Domain Controller is needed.

    5.  Trusted Certificate [Optional]: if you don’t want to get a warning on the certificate you will need to get a commercial certificate. Otherwise you can use an internal generated certificate and configure your Surface to trust the Root/Issuing CA.

    6.   DNS Record: you will need DNS record Points to your server.

     
    The RD Connection Broker is an optional as in our step we will use a single server that hosts everything, so the same server can monitor the sessions without the need of the RDCB. However in Windows 2012 the standard setup or the quick setup both will include RDCB as the recommended installation thus we are going to use it. If you are using Windows 2008 R2 or if you will use a custom installation you can choose not to install it and only use the RDSH and RDWA.
     
    Let’s not waste any more time, hereunder are the steps:

    1.  Install the required roles: I will use Windows 2012 so on the dedicated machine:

    a. Click Add Roles> Select Remote Desktop Services Installation:

    clip_image002
     

    b. Then select Standard deployment:

    clip_image004
     

    c. Select Session-based desktop Deployment:

    clip_image006
     

    d.  Under Role services the wizard will install the three roles: RDSH, RDWA and RDCB, as the following snapshot:

    clip_image008

     

    e.  Click Next.

    f.  Only if you get the following error continue with the following steps, if you didn’t get error then skip to step i. Error:

    “Unable to connect to the server by using Windows PowerShell remoting”

     
    The following snapshot shows the error:
    clip_image010

     

    g.      Start PoerShell as Administrator, and run the following cmdlet:

    Enable-PSRemoting -force
    Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000

    h.      The following snapshot shows the cmdlets:

    clip_image012
     

    i.   In RD Connection Broker: select the server name as the following snapshot:

    clip_image014
     

    j.    Do the same by adding the selected server in the RD WA and RD SH.

    k.   On the confirmation page click to restart the server after the installation and click Deploy to start the installation.

    clip_image016
     
    In this part we have installed Remote Desktop Services, in next part we will configure the server for RemoteApp.
     
    Links to All Parts:
    Part 1: Install Remote Desktop Services
    Part 2: Configure RemoteApp
    Part 3: Configure Surface
  • Host Integration Server 2013 TI Assembly GAC deployment Walkthrough

    Introduction

    Host Integration Server (HIS) is used to integrate with Legacy Host technology. One of the Host integration scenarios is to call Mainframe programs or transactions using a component in HIS called Transaction Integrator (TI). The way to use TI is to create what is called a TI assembly and then use this to call the Host systems from the Windows System. The TI assembly can be either used in a folder or deployed to the Global Assembly Cache (GAC). I wanted to deploy the assembly to the GAC to make sure it is available from anywhere in the integration solution and because I had strong named assemblies in the solution that required to reference this assembly. This blog post will provide the challenge and problems faced while trying to do this and how these were resolved to finally deploy the TI assembly to the GAC and use it from there in a BizTalk solution.

    Discussion

    Host Integration Server (HIS) is used to integrate with Legacy Host technology. One of the Host integration scenarios is to call Mainframe programs or transactions using a component in HIS called Transaction Integrator (TI). TI technology has been around for a while (it was used to be called COMTI) but it went through many changes and updates. In HIS 2013 the TI component undergone major changes. There are two scenarios to use the TI, either Host Initiated Processing (HIP) where the call is initiated from the Host server to the Windows server, in this scenario the Windows server acts as the backend and the Host is acting as the channel or initiating system. The other scenario is Windows Initiated Processing (WIP) where the call is initiated from the Windows platform and it is routed to the Host system. The diagram below illustrates this scenario.
    clip_image002

    Figure 1: Windows Initiated Processing Scenario

    To be able to implement a WIP scenario you need to implement what is called a TI assembly. This assembly actually governs the interface and mapping of parameters between the Windows system and the Host system. The way you create this assembly (as this is a special assembly type) is using the TI project template that ships with the HIS 2013. I am not going to describe how to create the TI assembly as you can find many references on how to do this in the HIS 2013 SDK here and on MSDN here.
    Once you have created the TI assembly you will have the following view in VS 2012.
    clip_image004

    Figure 2: TI Assembly in VS 2012

    Now to be able to deploy an assembly in the GAC you need to have that assembly signed with a key and then would have a strong name. If you click on the Library node (root node in the above figure) and check the properties you will see that it has the following properties:
    clip_image006

    Figure 3: TI Library Properties

    The property I am interested in is the KeyFile property which is according to the documentation if you provide a Key file in this property then the generated assembly would be signed with this key and would have a strong name (sweet). Unfortunately for some reason this does not work as expected and I could not get it to work and the assembly generated is always not signed.
    I have investigated many other options to sign the assembly after being compiled and this is doable but I wanted something more streamed and easier to be done if I needed to re-generate the assembly.
    Once I signed the assembly (as I will show you in the next section) and GACed it. When I create a BizTalk port using the BAHA adapter and try to configure it with the GACed assembly I found that the dialog to select the assembly from the GAC is always empty!  As per the below figure.
    clip_image007

    Figure 4: Select Assembly from GAC form

    The way to resolve also this issue and finally to configure the GACed assembly will be also presented in the following section.

    Solution & Walkthrough

    So let’s get to the way to get this working. The steps are as follows:

    Part 1: GAC the TI Assembly

    1-     Create the TI Assembly as you need and configure the calling model of the assembly to be “DirectCall, WCF, WS, BAHA”
    clip_image009

    2-     Now in the same properties make sure you have set the Debug property to “True”
    clip_image011

    3-     Now save the TI assembly and you will find the following are the generated artifacts in the output folder:
    clip_image013

    4-     Now take notice of the generated CS file marked above. Now create a new class library project and name it as you see fit. In that Class library project make sure that the .NET version is set to 4.0 at least (as HIS 2013 is upgraded to .Net 4.0) and then add the generated CS file to that project ( you might even add it as a link to make sure if the CS file is re-generated it is automatically updated in the class library project)
    clip_image015

    5-     Now make sure you add the following line to the AssemblyInfo.cs
    [assembly: System.CLSCompliant(true)]

    6-     Now go to the properties of the class library and make this library a signed library as you do with any C# library
    clip_image016

    7-     Add references to the following assemblies:
    clip_image018
    C:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.ClientContext.dll
    C:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.TBGen.dll
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.dll
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Services.dll

    8-     Now build the assembly it should build successfully and then add it to the GAC using Gacutil.exe as you would do with any other assembly. The TI assembly is now GACed and ready to be used.

    Part 2: Use the GACed TI assembly from BizTalk

    1-     Since the TI assembly is a .Net 4.0 assembly it will be GACed in the .Net 4.0 GAC and hence will require the .Net 4.0 Gacutil to be handled. Which comes installed with VS 2012.

    2-     Now for some reason the HIS HostApps adapter is not linked correctly to the VS2012 installation folder and hence I had to change things a little to make sure it is able to see the TI assembly in the GAC.

    3-     Open the Regedit application and browse to the path “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework”

    4-     Add a new string value with the name “sdkInstallRootv2.0” and set the value of this string to “C:\Gacutil4”

    5-     Now open the .net 4.0 tools folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools” and copy all the contents of this folder to the folder “C:\Gacutil4\Bin” (just create this folder).

    6-     Now open the BizTalk administration console.

    7-     Create a new send port in BizTalk

    8-     Select the HostApps as the adapter and then click configure and configure the connection string
    clip_image020

    9-     Now click add and then add assemblies (GAC) option
    clip_image021

    10-  Now you will see all assemblies installed in the .Net 4.0 GAC and you can select your TI assembly that you installed in Part 1 above
    clip_image022

    11-  Now complete the configuration as usual and click ok to configure the send port
    clip_image024

    12-  Now if you check the connection string created and compaire the TI GACed assembly with a normal one you will find this as below:

    <?xml version="1.0" encoding="utf-8"?>
    <mappings>
      <mapping>
        <assembly><![CDATA[C:\Program Files\Microsoft Host Integration Server 2013 SDK v1.0\ApplicationIntegration\WindowsInitiated\InstallationVerification\TiHostDefinitions\NetClnt1\bin\NetClnt1.DLL]]></assembly>
        <connectionString><![CDATA[CodePage=37;Name=TrmLink;TimeOut=0;SecurityFromClientContext=False;IPAddress=127.0.0.1;TCPPorts=7510;ConcurrentServerTransactionId=MSCS]]></connectionString>
      </mapping>
      <mapping>
        <assembly><![CDATA[MCS.Test.TI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2b679cb5291d11c2, processorArchitecture=MSIL]]></assembly>
        <connectionString><![CDATA[CodePage=37;Name=TrmLink;TimeOut=0;SecurityFromClientContext=False;IPAddress=127.0.0.1;TCPPorts=7510;ConcurrentServerTransactionId=MSCS]]></connectionString>
      </mapping>
    </mappings>

    13-  Now you can use this send port normally.

    Conclusion

    The HIS 2013 TI assembly can be installed in the GAC to simplify your deployment configuration. The walkthrough provided above can be used on the development machine to be able to configure the solution and build it but on the production environment no changes are required at all.
  • Load testing for WCF service (wsHttpBinding Binding) walkthrough

    In this walkthrough I will perform load testing for WCF service using VS 2012 ultimate version using test environment that consists of one controller and three agent machines, what we will cover in this walkthrough could be summarized into the following:

    • Configure test environment (one controller and three agents)
    • Install VS 2012 controller into controller machine
    • Install VS 2012 Agents into agent’s machines
    • Configure test settings for test project using VS
    • Install add-one for WCF Load Test for VS 2012 from ALM rangers
    • Create and configure Unit test project using VS IDE
    • Create load test project and run the test
    • Analyze the result

    First we will start by downloading the VS test agent and controller update 4 installers located at

    http://www.microsoft.com/en-us/download/confirmation.aspx?id=38186

    image

    image

    The installer consists of two folders and two installer files vstf_testagent.exe and vstf_testcontroller.exe

    First we will begin by Installing and configuring the controller, make sure VS 2012 is installed and running on controller machine, also SQL is needed to store performance data

    image

    image

    After finishing the installation lunch the test controler configuration tool

    image

    Here you have to specify which account to be used with test controller service and load testing database server that will store performance data.

    image

    Now Installing Agent on Agent machines, in our environment we will install it into three machines joined to same controller machine domain.

    image

    Next configure the Agents to connect to controller, in WCF scenario we need to run in as a service as no interaction is needed in load test.

    image

    Then configure the test agent by specifying the account name and the test controller we have created previously , make sure the port 6901 is set in test controller name

    image

    image

    Now after configuring the test Agents and controller we could create load test project using VS 2012 IDE, Create Web performance and Load test project from Test category in new project menu in VS 2012 IDE

    image

    From Load test manage test controllers to make sure all agents are connected and in ready state

    image

    list of agents getting displayed with status for each agent

    image

    To distribute the tests on agents we have to create test settings for load test project to enable remote execution on agents (running tests on Agents instead of controller only (local execution)),this could be accomplished by adding new item to project and choose test setting

    image

    Choose remote execution for test execution method

    image

    In test settings wizard you could specify the host where test will run

    image

    You could change the test time out as well

    image

    Now we will install the Load Tests add-on for VS for WCF, you could download it from URL:

    http://wcfloadtest.codeplex.com/

    After downloading and installing the add-on you could add new item with WCF test template that will start new WCF test generation wizard that will guide you to log the WCF call and save it as unit test

    image

    First you have to include the executable that calls the web service , in our case we developed a WPF application that calls the service

    image

    After calling the service from the executable the SOAP call is recorded as shown below

    image

    After the wizard is complete two CS files is added to your project

    image

    in next post we will proceed with configuring the WCF unit test and the remaining steps to perform the load test

  • ITPro: How to Convert your Surface RT to Surface Pro – Part 2

    In Part 1: I’ve explained how to install Remote Desktop services on the server and fix common error that you may face, that was the preparation for this part where we are going to configure RemoteApp.
     
    The following steps show how configure Remote Desktop Services and publish RemoteApp:

    1.     Follow the following steps to create a Session Collection:

    a.     From the Server Manager, click Remote Desktop Services on the left side.

    b. Click Collections> click Tasks, and then click Create Session Collection. Check the following snapshot:

    clip_image002

     

    c.     On the Before You Begin page of the Create Collection wizard, click Next.

    d.    On the Name the collection page, type SessionCollection in the Name box, and then click Next, as the following snapshot:

    clip_image004

     

    e.     On the Specify RD Session Host servers page, select the server name, click the right arrow, and then click Next.

    clip_image006

     

    f. On the Specify user groups page, accept the default selections (Domain Users), and then click Next.

    g. On the Specify user profile disks page, clear the Enable user profile disks check box, and then click Next.

    h. On the Confirm selections page, click Create.

    2.     Configure Remote Desktop Web Access Parameters: Change the URL the users will use to connect to: in Windows 2008 R2 that was very easy, however in Windows 2012 this can’t be changed. From the server manager click Edit Deployment Properties, check the following snapshot:

    clip_image008
     

    a.     When you open the properties, the RD Web Access can’t be edited:

    clip_image010
     

    b.     To change the name where the users will be connected to, we will need to get this PowerShell script: http://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80, and use the cmdlet Set-RDPublishedName ts.meamcs.com

     
    clip_image012
     

    3.     Allow Required Ports: Configure the Endpoints on Azure to allow access for HTTPS (443) and RDP (3389), from the Virtual Machine > click Endpoints.

    a.     Create new rule for HTTPS, and modify the existing port for the Remote Desktop, as the following snapshot:

     
    clip_image014
     

    b.     The following snapshot shows the final settings for the endpoints:

     
    clip_image016
     

    c.      Don’t forget to change your RDP connection to use now 3389 other than the random port you used to connect through it before.

    4.     Configure the Commercial Certificate:  to avoid getting warning on the HTTPs that the certificate is not trusted, we will need a certificate issued from commercial CA (or get internal generated certificate and configure your devices including Surface to trust the Root CA), in this scenario we will use publicly issued certificate:

    a.     Import the certificate to IIS: open IIS, under server name select Server Certificates:

    clip_image018
     

    b.     Import the certificate.

    c.      Configure Binding with the new certificate: click on the default website, from the Actions pane in the left select Bindings:

    clip_image020
     

    5.     Configure Remote Desktop to use the commercial certificate, so you don’t get any warning from RemoteApp (RDP connection) that the server is not trusted (default installation will use self-signed certificate):

    a.     Open Server Manager.

    b.     Browse to Remote Deployment Services.

    c.      Click Edit Deployment Properties.

    clip_image021
     

    d. Under Certificates browse to the PFX file of your commercial certificate as the following snapshot:

    clip_image023
     

    6.     Install programs on the RDSH server: To ensure that an application is installed correctly to work in a multiuser environment, you must put the RD Session Host server into a special installation mode before you install the application on the RD Session Host server. This special installation mode ensures that the correct registry entries and .ini files that are needed to support running the application in a multiuser environment are created during the installation process.

    To put an RD Session Host server into this special installation mode:

    a.      Open Control Panel > open Install Application on Remote Desktop Server

    clip_image025
     

    b.     Click Next on Install Program from Floppy disk or CD-ROM. (didn’t know that there are still programs on the floppy disks J, reminded me of the golden days when we had Windows 3.11 on 9 floppy disks)

    clip_image027
     

    c.      Browse to the application that you want to install, in this scenario I’m installing Project Pro.

    clip_image029
     

    d.     Click next to install the program.

    e.     Repeat these steps for all the programs that you want to install on your server.

    7.     Publish RemoteApp Programs:

    a.     Open Server Manager > On the left side of the window, click Remote Desktop Services.

    b.     Under Collections, click SessionCollection.

    c.      In the REMOTEAPP PROGRAMS tile, click Tasks, and then click Publish RemoteApp Programs.

    clip_image031
     

    d.     On the Select RemoteApp Programs page, select the programs that you want to add to the RemoteAPP, in my scenario this will be (Project, Visio, PowerShell ISE, PowerShell module for AD and Azure, Windows Live Writer), check the following snapshot:

    clip_image033
     

    e.     On the Confirmation page, click Publish.

    clip_image035
     

    f.       When the RemoteApp program is published, click Close.

    8.     Configure the File type Association:

    a. Open Server Manager > On the left side of the window, click Remote Desktop Services.

    b. Under Collections, click SessionCollection.

    c. Under the REMOTEAPP PROGAMS heading, right-click each program, and then click Edit Properties.

    clip_image037

    d. Click File Type Association.

    e. Select the required extensions as the following snapshot:

    clip_image039

    f.       Click OK.

    g.      Repeat the steps for all programs.

     
    In this part we did all the required configuration for RemoteApp, next part we will test from client side and configure Surface RT with RemoteApp.
     
    Links to All Parts:
    Part 1: Install Remote Desktop Services
    Part 2: Configure RemoteApp
    Part 3: Configure Surface