• A Small trick: How to extract a BizTalk BAM definition from an Excel sheet without installing Excel client

    This is a small trick that I have been doing for sometime now and wanted to share. The scenario is that you have prepared the BizTalk BAM definition and you ready to deploy it to the production environment, you run the bm.exe command and you see the situation; the BAM definition file is an Excel sheet and since you do not have Excel installed on the production server the installation has failed. Sad smile

    The options you have are either to your back to your development environment and export the XML from the Excel sheet or to install Excel on the production environment (not really an option).

    The trick is actually to open the Excel sheet in notepad as a normal text file and you would see something like this:

    image

    WOW wait a minute this XML seems familiar, right?

    Well you are correct this is the XML definition for the BAM view and activity. So simply copy this text and paste it in a new XML document and there you have it the XML definition of your BAM activity Smile

    Happy BizTalking Winking smile

  • How to configure SQL Database mail to send emails using Office 365 (Exchange Online): A walkthrough

    Introduction

    SQL Server has a feature called database mail. This feature allows the database server to send emails to any external entity using SMTP server. The problem happens if you have installed an on-premise SQL server and an online (Office 365) Exchange server in the cloud. How can you use this Exchange server in the cloud to send database emails?

    This blog post provides a complete walkthrough on how to configure this. This is based on the description provided in the KB article http://support.microsoft.com/kb/2600912.

    The Walkthrough

     The steps start with the following.

    Step 1: Get the SMTP settings for your Exchange online server

    1-      Go to the address http://dev.office.com to sign up for a trial account for office 365.

    2-      After the exchange service is provisioned go to the tenant administration page and click on Outlook
    clip_image002[4]

    3-      Click on the “clip_image003[4]” icon and then click options
    clip_image005[4]

    4-      Click on “Settings for POP or IMAP access…”
    clip_image007[4]

    5-      Take note of the SMTP server settings
    clip_image009[4]

    In this case the Server settings are noted as it will be used in the next step.

    Step 2: Install and configure an On-prem SMTP server

    Next you will need to install an SMTP server in your network to relay to the Exchange online. I am using Windows Server 2012 but you can use any SMTP server.

    1-      Configure the SMTP server role on your local server.
    clip_image011[4]

    2-      Open the IIS 6.0 management console. Right click on the SMTP server and open the properties window

    3-      Click on the delivery tab
    clip_image013[4]

    4-      Click “Outbound Security” and enter the login credentials you use for the Exchange online (and office 365) as below
    clip_image015[4]
    Remember to enable “TLS encryption”

    5-      Click “OK” then click “Advanced”. Enter the SMTP server URL you got in the previous step in the Smart host edit box
    clip_image017[4]
    then click “OK”

    6-      Click on “Outgoing connections” and set the port correctly to 587 (or depending on your SMTP settings)
    clip_image019[4]

    7-      Click “Ok” twice to apply the settings on the SMTP local server.

    Step 3: Configure the SQL Mail

    1-      Open the SQL management studio and connect to your local server

    2-      Expand the “Management node” and then right click the “Database Mail” node and click “Configure Database Mail”
    clip_image021[4]

    3-      Follow the wizard and the critical part is to configure the access account as per the below screen
    clip_image023[4]
    Please note that you enter the server to send to as localhost and the email address as the email you have on the office 365 Exchange online for the same account you used to configure the delivery configuration of the local SMTP server.

    4-      Once finished the configuration test the email sending and you should now be able to send emails to any external recipient using you Exchange online as the relay.

    Conclusion

    I have showed you in this post how to have an on premise SQL server connect and use an in the Cloud Exchange server to be able to send SQL database Emails.

  • SharePoint Provider Hosted App Walkthrough: Part 1 Preparation

    SharePoint and office development model is changing to a new App model. This is the new development model for SharePoint. In this blog series I will walk you through creating a provider hosted SharePoint App that is hosted in an App part. This will show the following key features:

    ·         How to prepare your environment for your App development?

    ·         How to develop a provider hosted App that is hosted in Azure websites and linked to SharePoint Online?

    ·         How to use the Client Object Model (CSOM) to read and write data back to SharePoint using the credentials of the logged in user?

    ·         How to handle multi-tenancy in your App?

    ·         How to package and sell your App on the market place?

    In this blog post (which is first of the series) I will provide some introduction and then will walk you through how to prepare and test your development environment with your first hello world provider hosted App.

    Introduction

    So the question here is, why the new development model? Looking back at SharePoint 2010, the common development approaches had a few challenges associated with them.

    With Farm Solutions, AKA Fully Trusted Solutions, custom code was deployed to the server. These types of solutions generally meant there were a lot of things to deploy to the server, even if they were all deployed in a SharePoint solution package. This also meant that most deployments required a server touch as an IT Pro with console access would need to upload the solution to the server’s solution store for deployment. In addition server outages and most SharePoint errors could usually be traced to custom code deployed to the server. These types of solutions are only available with on-prem deployments and not with hosted deployments that only allow sandbox solutions.

    Sandbox solutions have their own challenges in that they are limited in the number of things you can do. Developers can work within a subset of the full server-side API and are blocked from making external database or web service calls.

    Both of these options, farm & sandbox solutions, require the developer to have a solid understanding and be familiar with the SharePoint server-side API.

    To address many of the challenges developers and site owners had in previous versions of SharePoint, Microsoft has introduced a new development option for SharePoint 2013: The SharePoint App Model.

    In this new model apps do not necessary live within SharePoint. Instead the app’s business logic executes within the context of the client (browser) or externally from SharePoint. This external option could be another non-SharePoint Web server or a cloud server. Apps are also more secure in that when they need to access SharePoint resources such as lists and libraries they must be explicitly granted permissions to do so. This is implemented using OAuth. When an app is created, the developer specifies which permission the app needs in order to function. When the app is installed, the user installing the app is prompted to accept the permission requests the app needs (if they deny the permissions, the app is not installed). Once granted permissions, the apps can then talk to SharePoint using the Client Side Object Model (CSOM) or using some of the new OData services in SharePoint.

    Developers can build apps and submit them to a marketplace making it easy for customers to acquire these applications.

    clip_image002

    Hosting Options

    The Cloud App Model offers multiple hosting options for your app. You can choose your own web stack, have Microsoft provision Windows Azure and SQL Azure, or have it hosted on SharePoint, as shown in the Figure below.

    clip_image004

    For more details on the hosting options please refer to the MSDN link http://msdn.microsoft.com/en-us/library/fp179887.aspx.

    In a nutshell the following figure illustrates the hosting options.

    clip_image006

    In this blog series I will focus only on the provider hosted model.

    Preparing the Development Environment

    Now let’s get into business J

    To prepare your development environment you require a machine with Windows installed (of course) and Visual Studio 2012. The steps to prepare your environment are as follows.

    1-      Go to the web site: http://dev.office.com

    2-      Click on the big start button
    clip_image008

    3-      Then click on the “Sign up” link (you need to expand the section above it to see this)
    clip_image010

    4-      Then enter your details and click “Create my account”. The important point is that you will have to select a new URL that is unique to you.
    clip_image012

    5-      Once this is done it will take you to the Tenant administration page and you will see that it is still preparing your account to be patient as it takes around 20-40 minutes to complete everything.

    6-      Once it is ready you will see the following view
    clip_image014

    7-      Now click on the “Build Apps” link at the top to take you to your developer site. Which would look like the below.
    clip_image016

    8-      If your view is anything different than the above then creation has failed really, so you need either to wait a little more so that the site is correctly provisioned or to re-create a new tenant.

    9-      Now on your machine browse to the site http://www.microsoft.com/web/handlers/WebPI.ashx?command=GetInstallerRedirect&appid=OfficeToolsForVS2012GA which would open the Web Platform installer to install the required office development tools and templates for Visual Studio 2012. (Or go the site http://msdn.microsoft.com/en-us/office/apps/fp123627 to get the updated link if this changes)

    10-   After several components installations you should finally install this as below
    clip_image018
    Please note that sometimes it fails to be installed simply close the installation and do it again. I had to do this three times until I got it installed correctly.

    11-   Now let’s open Visual Studio 2012 and click on new project you will find new templates added for the Apps for SharePoint and office as below
    clip_image020

    12-   Click on new Apps for SharePoint, enter the name HelloAppModel (or anything else) and click ok. Now enter the URL of your developer site that you created in step 7 above and do not forget to select provider hosted model as below
    clip_image022

    13-   Click “Next” and you will now enter the server to server credentials (certificate) in our case since we are working on SharePoint online we can use the client secret since the SharePoint online farm is connected to ACS.
    clip_image024

    14-   Click finish to get the project created and you would see two projects as below
    clip_image026

    15-   Now edit the web site main page to see these changes to your web site (optional)

    16-   Simply hit F5 to start the deployment and debugging.

    17-   This will ask you to login to your site as below
    clip_image028

    18-   Once you do this it will open the browser and point to the default app site and you have to sign in again.

    19-   Then it will ask you if you trust this App
    clip_image030

    20-   Click “Trust It” and here you go
    clip_image032
    as you can see the URL is referring back to your machine and the source URL is the SharePoint online URL.

    Now if you think about this, where is the App is hosted?! The answer is simple it is hosted on your development machine now using the IIS express that comes with Visual Studio 2012 so it is provider hosted, in a sense.

    In the next blog post we will become more aggressive and go deeper in our code to read from and write to SharePoint online.

  • Office 365 Arabization – Part I

    In this article, we will answer the following questions:

    - How can we use Arabic in Office 365? What fields can be Arabic?

    - How can we manage Arabic users?

    Let’s start from the beginning, company wants to utilize Office 365 and everything expected to be in Arabic, so first question:

    1. What are the fields that supported to be Arabic?

    The answer is you can create users with everything in Arabic (even the display name) except the User Name and the Password that should be in English, check the following snapshot:

    o365-01

    Having all users in Arabic will result in having the Global Address List (GAL) with Arabic in all fields, which will be great to match the customer request, check the following snapshot:

    o365-02

    And in Lync Arabic is also supported in search and display:

    o365-03

    Let’s move to more advanced question how can we manage users with Arabic?

    If you will use the portal to manage users, Arabic will be ok with you, also you can search in Arabic:

    o365-04

    You can also manage Exchange from the portal and Arabic is supported even in the search, check the following snapshot:

    o365-05

    However, the main issue here is when using PowerShell to manage Office 365:

    o365-06

    The above is expected because PowerShell doesn’t support Unicode characters, thus Arabic is not supported in PowerShell and we will get the hieroglyphic characters Smile.

    The solution for that is to use Windows PowerShell Integrating Scripting Environment (ISE).

    Windows PowerShell Integrated Scripting Environment (ISE) is a host application that enables you to write, run, and test scripts and modules in a graphical and intuitive environment. Key features in Windows PowerShell ISE include syntax-coloring, tab completion, Intellisense, visual debugging, Unicode compliance, and context-sensitive Help, and provide a rich scripting experience.

    PowerShell ISE is installed by default in Windows 8, for Windows 7 and 2008 R2 can be downloaded from Microsoft Download Center: Windows Management Framework 3.0

    PowerShell ISE is very useful tool; you can get more information about it from this URL:

    http://technet.microsoft.com/en-us/library/hh849182.aspx

    For our problem the main advantage is the support of Unicode Language, thus ISE will be perfect to manage Office 365 and get all the Arabic characters:

    o365-07

    Also can be used to modify any attribute in Arabic as the following snapshot:

    o365-08

    In this blog we answered how can we use Arabic in Office 365, what fields are supported in Arabic, and how can we manage Office 365 users created in Arabic, in the following article we will go through more advanced topics in managing and administering Office 365 tenant and of course in Arabic Language.

     

    Other Parts:

    Part I: Arabic Problems

    Part II: Users Bulk Creation

    Part III: Users Bulk Modification

    Part IV: Dynamic Distribution Group

     

  • SharePoint 2013 Backup with PowerShell and Task Scheduler for beginners

    You can do Everything with PowerShell - yes everything - and SharePoint is no exception. In this post for beginners, I will show you how to create tasks for the Task Scheduler to automate your SharePoint backups with PowerShell.

    First, to backup your farm, you can use the PowerShell command Backup-SPFarm. For more details on this cmdlet, refer to http://technet.microsoft.com/en-us/library/ff607881.aspx. You can use the command to backup the farm a full backup as in the following example.

    Backup-SPFarm -BackupMethod Full -Directory \\MyServer\SPBackups

    And to backup the farm a differential backup, you can use the command as in the following example

    Backup-SPFarm -BackupMethod Differential -Directory \\MyServer\SPBackups

    To create a PowerShell script file, open a notepad file and save it as *.ps1. Let's create two files - one for the full backup and another for the diff backup.

    So create two files: SPFarmFullBackup.ps1 and SPFarmDiffBackup.ps1

    In the first file for the full backup, type the following text.

    Add-PSSnapin "Microsoft.SharePoint.PowerShell"

    Set-ExecutionPolicy -ExecutionPolicy "Unrestricted" -Force

    Backup-SPFarm -BackupMethod Full -Directory \\MyServer\SPBackups

    Save the file.

    In the second file for the differential backup, type the following text.

    Add-PSSnapin "Microsoft.SharePoint.PowerShell"

    Set-ExecutionPolicy -ExecutionPolicy "Unrestricted" -Force

    Backup-SPFarm -BackupMethod Differential-Directory \\MyServer\SPBackups

    Save the file.

    Now, follow the steps below to create the tasks for Task Scheduler to automate the execution of backup files - let's assume we will full-backup weekly and diff-backup daily.

    1 - Open Tools > Tasks Scheduler

    2 - In the center pane, right-click, and click Create Basic Task

    3 - Assign the task a meaningful name - such as SharePoint-BackupFullWeekly

    4 - Choose "Weekly " on the When do you want the task to start screen

    5 -  Specify the parameter for the weekly task schedule

    6 -  Choose "Start a program" from the what action do you want the task to perform

    7 -  On the start a program screen type in the command as the screenshot below. The Task scheduler is intelligent enough to recognize that you want to run PowerShell and that you supplied arguments.

    Repeat the steps above to create a task for the diff backup.

    Remarks:

    Good Luck!