I am a Unified Communications Engineer and the reason I decided to write this Guide is that, I could not really find any blog post describing its installation, except Microsoft’s own detailed guide which isn’t for newbies by any means. So I really hope that unlike me, this saves the day for you.
Before we begin the actual installation, here are a few things that you should know. Most part of this guide has extracts from the Microsoft Lync IM an Expert detailed setup guide which can be downloaded here but in this simple How to you’d get to know the basics to get the thing up and running. You can obviously consult the guide for advanced configurations.
IM an Expert is a Lync instant messaging question-and-answer service that enables users to find answers to questions by asking other users. There are several components in the IM an Expert service:
· Bot: The automated service that users communicate with via instant messaging (IM). This handles question processing, expert location, and dialog management.
· Website: A website describing the service, where users can also provide profile information, review and answer previous questions, and see their position on the leaderboard.
· Databases: SQL Server databases containing user profiles, questions, conversations, ratings, and indexed content used in ranking experts.
· PageCrawler: Automatically crawls the contents of websites listed in user profiles, and then stores them in a database table.
· Indexer: Indexes all available content about a user in preparation for expert finding.
· Monitor: Ensures the Bot is up and running normally, and sends an email to the administrators if it detects a problem.
We will be installing all the Components on a single machine (Windows Server 2008 R2 x64) which has the following things already installed.
- Microsoft .NET 3.5 SP1 or later
- Microsoft Unified Communications Managed API 3.0 Runtime (UCMA3.0). Download here
- Microsoft SQL Server (Can be on a different machine).
I did this lab installation on Windows Server 2008 R2 SP1 and SQL 2008 R2 but any 2008 version of Windows and SQL should do. If you already have SQL Server installed on some other server in your environment, you can use that as well. I’m not going to cover SQL Installation here, but its very much like a standard installation or like the one you might have installed for Lync Archiving/Monitoring Server. The only addition is that Full-text search (an optional component of the SQL Server Database Engine) MUST be installed on the instance that would be used to create Lync IM an Expert databases. Lync IM an Expert does NOT necessarily require a separate instance.
We would also need 2 Service Acounts enabled for Lync and Email. Although we can call them anything, for the sake of simplicity we would call them firstname.lastname@example.org (The main service account for the installation) email@example.com (Ensures the service is running and everything is functional).
During the course of this guide whenever you need to RUN something example bot.exe make sure you do it through CMD and Run the CMD as Administrator if required.
The Actual Installation:-
Step 1 – Download and Run Lync IM an Expert Installer
Download Lync IM an Expert Installer from here and complete the installation Next Next Next. Nothing special unto this point.
Step 2 – Setting Up Databases and Tables in Microsoft SQL Server
1. Run SQL Server Management Studio (SSMS).
2. Create three databases: IM-an-Expert, IM-an-Expert_Index, and IM-an-Expert_Data. These correspond to the IM-an-Expert, Index, and PageCrawler databases mentioned earlier, respectively.
3. For IM-an-Expert, execute the %INSTALLDIR%sqlimxtables.sql script. When complete, it should say “1 row(s) affected” and the database should contain 8 tables.
4. For IM-an-Expert_Index, execute %INSTALLDIR%sqlimxfulltext.sql. Note that it contains the language identifier for the word breakers used in the full-text index (i.e., 1033 for English). If creating a non-English index, you should replace the “1033” in the script with the locale identifier (LCID) of the language that they want to use for word breaks.
5. For IM-an-Expert_Data, execute the %INSTALLDIR%sqlimxdata.sql script.
6. Add Service user (firstname.lastname@example.org) in SQL logins, set it up with Windows Authentication, map it to all the 3 databases above and finally give it owner rights on all the 3 databases.
Step 3 – Configuring IM an Expert: Bot (Bot.exe)
Each component has a small config file (named, for example, Bot.exe.config) which simply points to the shared configuration file located at %INSTALLDIR%configimx.config. Some of the keys contained in imx.config are used only by one component, while others are shared by many components. We would basically need to Step by Step edit this imx.config file to get all the Components running.
We would only edit the least number of settings required to get the bot running. They are as follows:-
· BotSipUri – sip:email@example.com (The SIP address of the service account that we created)
· BotSipServer – Your Standard Edition Server or Front End Pool e.g LyncSE.domain.com
· BotSipPort – 5061 in most cases
· BotUsername – firstname.lastname@example.org or Domainimexpert (Works both ways)
· BotPassword – The password for your Service account
The screenshots below show what I did in my lab to get the bot running.
The important thing to NOTE in Database Settings is that the username and password must be encrypted, contrary to claim in the documentation that unencrypted username and password also works. Or may be you need to enable plain authentication in SQL database security and it might work for you. The simplest encryption we can use is NT encryption which is Windows based. You can do it by replacing the uid:*****;pwd:*****; parameter withIntegrated Security=SSPI;
After setting up the imx.config file with the correct usernames, passwords, database names, etc., start the Bot by starting a command prompt window (“Start” > “cmd”), change directory to %INSTALLDIR%binBot, and runBot.exe. The Bot logs are written to the location specified by BotLogFilePath in the configuration file.
You should see messages describing the Bot’s progress in logging into Lync, followed by a “Ready” message. When the “Ready” message appears, the Bot has successfully signed and can receive questions.
Step 4 – Configuring IM an Expert: Setting up the Website
1. Download and run MSChart, from here
2. Use Internet Information Services configuration to create a new Application Pool specifically for IM an Expert and add a new website and point it at %INSTALLDIR%website. Then give the IIS user permission to access this directory. I used the same Service Account for every purpose starting from Bot to SQL to Website (except the Bot monitor) of coarse. Also you only need to add binding for Port 80 only, since Certificate is NOT a requirement we would like to keep it as simple as possible.
3. Ensure the Website is configured to execute ASP.NET scripts.
4. Ensure “default.aspx” is set as the default content page for the application.
5. Ensure anonymous access is disabled and windows integrated authentication is enabled.
6. Edit the imx.config file to set WebsiteMessagesFile to the absolute path of the messages file, and ensure the Web server and IIS user account has access to that file.
7. If you configured the DBConnectionString to use integrated NT security, ensure the IIS user has read/write access to the IM-an-Expert and IM-an-Expert_Index databases. Since we are using the same user it would automatically have those permissions.
8. Modify the HTML source of the “Contact.aspx” page to change the text of the “insert administrator email” link to the correct email address for the IM an Expert administrator.
9. Modify the HTML source of the “Default.aspx” page to change “insert bot username” to the correct username for the IM an Expert bot.
Step 5 – Configuring IM an Expert: Indexer (Indexer.exe)
The imx.config contains information about the location of the IM-an-Expert_Index database:
The only thing that you need to specify here to get this running is connStr
<add key=”IndexDBConnectionString” value=”connStr:server=server2;uid=******;pwd=******;database=IM-an-Expert|tableName:Users|keyCol:username|valueCol:keywords|weight:10″ />
To run the re-indexer, start %INSTALLDIR%binindexerIndexer.exe. The Indexer logs are written to the location specified by IndexerLogFilePath in the configuration file.
To ensure successful re-indexing of user profiles, you should create an SQL Server Agent scheduled rebuild task using SQL Server Management Studio. To create the scheduled task, you should:
1. Ensure the SQL Server Agent is running, and set as an “Automatic” service that starts upon the startup of the database server.
2. Run SQL Server Management Studio.
3. Under “Object Explorer”, select “SQL Server Agent”, then “Jobs”, and then “New Job…”
4. Specify the following in the window that appears:
Name: Rebuild IM an Expert Index Catalog
Owner: Set this to a user with ALTER table permissions on the IM-an-Expert_Index database.
5. Select the “Steps” tab from the options on the left of the window.
a. Click the “New…” button to add a new step.
b. Give the step a name, such as “Rebuild catalog”.
c. Leave “Run as” blank.
d. Add the following in the “Command” window:
ALTER FULLTEXT CATALOG [Profiles] REBUILD
e. Go to “Advanced” settings.
f. Change the “On success action” to “Quit the job reporting success”.
g. Click “OK”.
6. Select the “Schedules” tab from the options on the left of the window.
a. Set up a recurring schedule. We recommend you run this job nightly after the indexer has completed. For example, the indexer scheduled task might run at 1am, and this job might therefore start at 5am.
7. Select the “Notifications” tab from the options on the left of the window.
a. Check “Write to the Windows Application event log”.
b. Set other properties as desired.
Step 6 – Configuring IM an Expert: Crawling (PageCrawler.exe)
You need to setup imx.config to specify various parameters for the PageCrawler.
The only thing that you need to specify here to get this running is connStr
<add key=”PageCrawlerDB” value=”connStr:server=server2;uid=******;pwd=******;database=IM-an-Expert_Data|tableName:WebCrawl” />
and either delete <add key=”PageCrawlerProxy” value=”proxy”/> or setup the proxy as desired.
To run the crawler, start %INSTALLDIR%binpagecrawlerPageCrawler.exe. The PageCrawler logs are written to the location specified by PageCrawlerLogFilePath in the imx.config file.
Web pages will not be entered into the index until the PageCrawler, Indexer, and the SQL Server Agent catalog rebuild task are run. Therefore, you are recommend that the PageCrawler be run periodically by setting up a scheduled task that will run this process, e.g., weekly.
Step 7 – Configuring IM an Expert: Monitor (Monitor.exe)
The minimal set of keys that needs be modified for the Monitor to run is as follows:
To run the Monitor, start %INSTALLDIR%binmonitorMonitor.exe. The Monitor logs are written to the location specified by MonitorLogFilePath in the imx.config file.
Step 8 – Running IM an Expert
1. Add the Bot Sip URI onto your Lync Client
2. Create a Profile and ask others to do the same
3. Start asking questions
Finally, you’d be ready to experience this wonderful new idea live on your own system. I hope this really helps to quickly set things up and you don’t end up spending hours on these little things and often pulling your hair in the process.
As this is my First Post do let me know if I missed something. Also please do comment if you liked it or found it useful.