I have decided to move my blog to a personally developed site where I can create better content. The site is build on Node.js and hosted on the Azure Cloud platform.

Site: http://www.devlaundry.com

Please visit the new site and any feedback will be appreciated. I will move some of my blog entries over to the new site. Hope to see you on the new site!!!

When you are hit with a problem in SharePoint 2010 you get notified to use a correlation id to check for further details in the trace logs (ULS logs).

SharePoint Error

So you hopefully start up ULS Viewer and open up the relevant logs and search like a mad man after this specified correlation id. Sometimes you don’t find the provided correlation id in the log file you opened. Is there a easier way?

ULS_Viewer

Yes and that is to use the SharePoint PowerShell command Merge-SPLogFile. According to the description of Merge-SPLogFile on Microsoft TechNet:

“Combines trace log entries from all farm computers into a single log file on the local computer.”

Let me explain how you can use this powerful command.

Basic Usage

Lets visualise a simple farm.

Farm Design

As the example Farm image above we have two frontend servers, application server and database server. If I wanted to consolidated the last hour of SharePoint log entries from the front-end server and application server I would open up SharePoint Management Shell on one of the servers and type the following command:

Merge-SPLogFile –Path “E:\SPLogs\MergedLogs.log” –Overwrite

Merge-SPLogFile_Basic

Now that was a very basic example to merge the various servers log files. More parameters are available on the Microsoft TechNet article for Merge-SPLogFile. For example Area, Category, Level, Message, StartTime, EndTime and more.

Finding Correlation ID

What the following example show is how to find the log entries for a specific correlation id:

Merge-SPLogFile –Path “S:\SPLogs\MergedLogs.log” –Correlation 3ae2a6c0-da14-43a1-afda-5bb6bbff3d43 -Overwrite

Merge-SPLogFile_Correlation

Since the log files are merged with just the specified correlation id you can load the log file in ULS Viewer to easily view the entries. Please be aware that the log can be empty if the logging level is set to low for the SharePoint category. Just go to SharePoint Central Administration to increase the logging level.

ULS_Viewer_Correlation_Result

As you can see in the image above the correlation id has 19 matching entries in the log file. Much less log entries to scroll through.

Summary

I hope this helps you on finding SharePoint errors quicker and easier. Let me know what your favourite commands and tools are for debugging SharePoint.

@cecildt

As of SQL Server 2012 it is easier to slipstream the latest service packs and cumulative updates to create new SQL Server installations. It is a slow process to first install SQL Server and then apply the latest updates afterwards.

 

The Usual Approach

The usual approach to slipstream SQL Server 2008 and SQL Server 2008 R2 has been documented on MSDN blogs where you needed to download update packages for all architectures and extract to a directory and copy over to the original SQL Server Setup files. Make changes to the configuration files to specify the updates and then proceed with the installation of SQL Server. It was basically allot of steps to do.

The Change Approach

Microsoft decided to change the way updates are applied with SQL Server 2012 installations. The new approach is much better. The change is documented on MSDN article about “Deprecated SQL Server Features of SQL Server 2012”.

The steps is as follow. Download the latest cumulative update for example CU2 for SQL Server 2012. Then you need to run the downloaded file to extract to a directory C:\SQLUpdates for example.

SQL_Update

The CU2 download filename is “449398_intl_x64_2012_SQL_CU2.exe” and when you run the file it exact an file with the name “SQLServer2012-KB2703275-x64.exe”. You do not have to extract the the file again.

Updates_Directory

Now open command prompt and navigate to the original SQL Server 2012 setup files. In command prompt type the following command to start the setup:

Setup.exe /Action=Install /UpdateEnabled=TRUE /UpdateSource="C:\SQLUpdates"

The additional parameters are self explanatory, but lets go through them:

  • Action = Specify that we want to perform an install of SQL Server 2012.
  • UpdateEnabled = Specify that the setup should include updates in installation.
  • UpdateSource = Specify location where updates are available

Setup_Command

After running the command you will see the default install screens for SQL Server 2012. After the setup checks screens you will see the Product Updates screen that list available updates in the specified directory.

SQL_Setup_Product_Updates

That is basically it. The SQL Server Setup will only use the updates that are available in the specified directory and automatically extract them. You don’t have to download all the available architectures, just the ones that you need.

Summary

In summary you can see that the new approach is much easier than before. You can still use the ConfigurationFile.ini and DefaultSetup.ini to specify available updates as well. I hope this change encourage you to always stay up to date with the latest service packs and cumulative updates as they come out.

@cecildt

I was busy setting up a new VM with SQL Server 2012 with the latest cumulative update (Build: 11.0.2325.0) and all the features enabled for installation. On the end of the installation summary page it show that SQL Server Analysis Services failed. The installation did install the Analysis Service but viewing the SQL Server Services in SQL Server Configuration Manager it show the Analysis Service did not start, that is why the installation show failed.

Analysis Service Error

Problem

I went and look into Windows Application Event Viewer for further details and the following error has been logged:

Message-handling subsystem: The message manager for the default locale cannot be found.
The locale will be changed to US English. Message-handling subsystem: The message manager for the default locale cannot be found. The locale will be changed to US English. File system error: The following error occurred during a file operation: Access is denied. . (
\\?\E:\Data\CryptKey.bin).

At first I thought there is some server locale issue. As you can see at the end of the message there is an “Access is denied” issue. Which is related to permissions to some resource. To understand why I get this error I need to explain my server setup.

The newly created VM has a C drive and an additional E drive. As you know the C drive is for OS and program files. The E drive is where I put all the SQL Server databases files and folders. On the E drive I created the following directory structure:

SQL_Folder_Structure

For each SQL Server Service I create dedicated accounts:

  • SQL Engine Service: sql_eninge_service
  • SQL Analysis Service: sql_analysis_service
  • SQL Reporting Service: sql_report_serivce
  • SQL Agent Service: sql_report_service

Solution

You get the picture. Now back to the “Access is denied” error. I had to give the SQL Analysis Service account write access on E:\Data and E:\Logs directory and then the SQL Analysis service started up successfully.

Add Permissions

Summary

In summary if you create your own service accounts and have your own predefined folder structure you can get permission errors from SQL Server. Always keep your eye on Windows Application Event Viewer to see any SQL Server permission errors and give the right permissions to each service account.

Cheerio!

I had a issue with SQL Server Agent Service that cannot start up after creating a new clean installation of SQL Server 2012 with the latest cumulative update (Build: 11.0.2325.0). My first step was to look at trusty old Windows Application Event Viewer to see what messages get logged when I try to start the SQL Server Agent Service.

 

Problem

In Windows Application Event Viewer the following error message is logged:

OpenSQLServerInstanceRegKey:GetRegKeyAccessMask failed (reason 2).

The problem is that the default account that is created by the SQL Server installation that is used by the SQL Server Agent Service does not have the correct permissions.

Agent Start Errors Auto fix

 

Solution

The easy solution is to use the SQL Server Configuration Manager to change the SQL Agent Service account to Local Service and then the SQL Agent Service will start up successfully.

My preferred approach is to create a dedicated domain account for example: sql_agent_service. Assign this account to the SQL Agent Service via SQL Server Configuration Manager. When you start the SQL Agent Service you will see that the service start up successfully.

If you go back and view the Windows Application Event Viewer you will see the error again, but additional messages are logged where an advance configuration setting has been automatically changed in SQL Server 2012. The Agent XPs configuration option has been enabled which allows the Agent Service to start up successfully.

Auto fix Set Agent XPs

To make sure the error is gone, clear the Windows Application Event Viewer. Stop and start the SQL Server Agent Service and make sure there are no errors logged again.

By default the advance Agent XPs configuration option is disabled on new installations. You should enable it to make sure the SQL Agent Service work correctly.

Here is the TSQL to enable Agent XPs manually:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO

 


Summary


In summary you should define dedicated accounts for each SQL Server Service up front before you install SQL Server 2012. This will allow you to know which account has permission issues when a SQL Server service cannot start up successfully. Always keep your eye on the Windows Application Event Viewer for SQL Server errors!


Cheerio!

Virtualization of SQL Server these days are becoming more a reality and common practice. Usually if you you mention SQL Server and Virtualization in one sentence people will look at you as if you are a mad man.

With this post I would like to talk about a couple of notes you need to consider when you virtualize SQL Server. When using a hypervisor to consolidate your SQL Servers into a virtualization environment you need to think about the impact on CPU, Memory, Storage and Network performance and management.

Let’s break it a bit down further with some checkpoint.

CPU

  • Always ensure that you disable power management for CPUs in the BIOS of the physical servers. You want the full power of your CPU available at all times.
  • In your Guest VMs make sure that the Power Management Plan is set to High performance.
  • The different levels of CPU cache has a big performance impact. Try to use the latest CPUs that have big level 3 cache. Level 3 cache in the latest Intel CPU are shared among the individual cores. This allow the hypervisor to reuse the same CPU to schedule work among the cores for your SQL Server virtual machine where certain SQL Server data is cache.
  • Assign minimal virtual cores to your SQL Server virtual machine and scale up the CPU count as required when workload increases. This allow the hypervisor the reuse the same CPU socket where certain data can remain cache rather than distribute across all available CPU sockets where you will be hit by cache misses.
  • Monitor for throttling of the CPU.
  • Avoid affinity masking.
  • Use CPU-Z to make sure your CPU is performing optimally.

Memory

  • From your hypervisor reserve memory to your SQL Server virtual machine. This allow other virtual machines not to consume your memory and allow the Balloon driver not to force your SQL Server virtual machine under memory pressure to release memory.
  • Set your SQL Server minimum and maximum memory according to your reserve memory. Don’t assign all available memory you must leave some head room for the Windows Operating System.

Storage

  • Still apply the same best practices for SQL Server database files.
  • Try and stick to RAID10.
  • You can use Pass-Trough disks in your hypervisor. Which give you slightly better performance than virtual disk drives.
  • You can use Shared or Dedicated LUNs via your hypervisor. Depended on your business requirements.
  • Correctly configure multi-pathing on your SAN.
  • Avoid 1GB iSCSI for storage, try going higher.

Network

  • Assign dedicated Network Card interfaces via you hypervisor to the SQL Server virtual machine.
  • Make sure good practices are followed for network redundancy.
  • Avoid multiple virtual machine using the same network interface.

These checkpoints are some of the common practices to follow when setting up SQL Server in a virtualization environment. Virtualization setup comes down to what you can afford and what your business requirements are.

The key areas to successful deployments are:

  1. Always use the latest version of the vendors hypervisor.
  2. Follow the vendor’s best practices.
  3. Always and always monitor the physical environment and guest virtual machines for optimizing the performance.

Microsoft Hyper-V

The Microsoft Hyper-V hypervisor does have its own best practices for deploying SQL Server. One feature that you should try and avoid is dynamic memory. You should always use static memory assignment for SQL Server virtual machines.

Here are some documents to review if you are going to use Microsoft Hyper-V.

  1. Running SQL Server with Hyper-V Dynamic Memory Best Practices and Considerations
  2. Running SQL Server 2008 in Hyper-V Best Practices and Performance Recommendations
  3. High Performance SQL Server Workloads on Hyper-V

VMware vSphere

The VVMware vSphere hypervisor has its own best practices for deploying SQL Server. A very nice feature that vSphere has is memory compression. This feature is where multiple pages in memory that are the same is removed from memory. Only keeping one copy in memory. This is a great benefit for Operating System pages in memory, but no real benefit specifically towards SQL Server. 

Here are some documents to review if you are going to use VMware vSphere.

  1. Availability Guide for Deploying SQL Server on VMware vSphere
  2. Performance and Scalability of SQL Server on VMware vSphere
  3. SQL Server on VMware Best Practices Guide

Conclusion

On the end there are allot of guidance from the individual vendors for optimal deployment of SQL Server in an virtualization environment. There are many benefits like cost savings and management in using virtualization. I would really recommend that you try setup a test environment to see the benefits.

Performance is always a concern, but at the rate at which hardware performance are increasing the little bit of performance impact you experience right now with virtualization will be a thing of the past with new hardware. Especially with enterprise SSD disk drives that are coming out at a good price.

One person that I follow that provides brilliant content on SQL Server virtualization is Brent Ozar. He has many articles and videos on virtualization.

If you have any comment or questions about SQL Server virtualization please feel free to contact me.

Cheerio!

Today is the start of a very exciting and challenging journey to become a Microsoft Certified Master on SQL Server 2008. This post is about my planning on achieving the certification.

The Motivation

Over the years I have worked in various environments that involved development with SharePoint, BizTalk, Integration, Web and custom development. All of them had one thing in common and that is they all use SQL Server. I always enjoy and have allot of passion working within SQL Server. Always learning the little bits about the ins and outs of SQL Server is fun. Working with SQL Server all over the years came to a point that I ask myself  how can I improve myself to be better at what I do and know. That has put my focus on achieving the Microsoft Certified Master on SQL Server 2008.

The Schedule

How am I going to achieve this and by when? My personal schedule is to write the MCM on SQL Server Knowledge Exam in the first week of May 2012. If I pass that exam then it will onto the MCM on SQL Server Lab exam. From today it leaves me with roughly 3 months for studying.

As mentioned by other MCMs that studying alone is not enough. You do need years of experience working with SQL Server.

The Resources

Where are the resources? There are various books, whitepapers and blogs that needs to be studied that will help with the exams. On the official page and from SQLskills.com you get links  to the recommended resources. There are also training programs available that can be attended for preparation to the Microsoft Certified Master on SQL Server 2008 exams. 

The OneNote

There are so many resources available on the internet that it can be a big tasks to get these resource organized. I took the time in my planning to organise the resources into a Microsoft OneNote document. You can download it from here.

The OneNote document is divided into sections namely:

  • Videos
  • Stairways Series
  • Books
  • Blogs
  • SQLSkills Training

The videos section includes the links to the recommended readiness videos for Microsoft Certified Master on SQL Server 2008. The Stairways Series section is links the various topics about SQL Server that is provided by SQLServerCentral.com. The Books section has links to the recommended books for reading. The White Papers section are the whitepapers that must be read for the exams. The Blogs section is links to some additional reading for the exam. Lastly the SQLskills Training section has been broken down to sub sections with the various resources links that is mentioned on SQLskills MCM page.

If you are also going to do the Microsoft Certified Master on SQL Server 2008 exams I hope this document can help you on your journey. Also if you find resources that I might have missed let me know and I will update the document.

Again here is the full link to the document:  http://dl.dropbox.com/u/4406115/MCM%20SQL/SQL%20MCM%20Training.one

mcm_onenote

Conclusion

In conclusion as I mentioned in the beginning of this post, it is going to be a very exciting and challenging journey to be come a  Microsoft Certified Master on SQL Server 2008. I will continue to put up posts as my learning progresses on the topics of SQL Server. For those who also attempting these exams as well, best of luck and see you at the other end.

Cheerio!

Intro

If you are a SharePoint Developer or Administrator you know it can take a long time to deploy SharePoint 2010 and difficult to remember everything that you have to configure in SharePoint 2010. A easy deployment solution is available to quickly deploy SharePoint 2010.

The Solution

The easy deployment solution is the CodePlex project namely AutoSPInstaller. This project use the power of PowerShell to automate deployment and configuration of SharePoint 2010. The PowerShell scripts allows you to deploy SharePoint 2010 with prerequisites, service packs and updates, Forefront Security, Language Packs, Office Web Apps and PDF iFilter with icon.

For a detailed guide to use the AutoSPInstaller scripts go to Tobias Lekman post: http://blog.lekman.com/2010/11/automated-sharepoint-2010-installations.html

These scripts allow you to configure SharePoint 2010 once according to your requirements and use it over and over again.

Developer Setup

What about a basic SharePoint 2010 setup for development? Well, Microsoft created a easy setup script to setup the following on a machine or VM:

  • SharePoint Server 2010 + Pre-requisites (Standalone)
  • Visual Studio 2010 Ultimate Edition
  • Silverlight 4 Tools for Visual Studio
  • Expression Studio 4 Ultimate
  • Open XML SDK
  • Visual Studio SDK
  • Visual Studio SharePoint Power Tools
  • Office 2010 Professional Plus
  • SharePoint Designer 2010
  • Visio 2010

The download location for SharePoint 2010 Easy Setup Script: http://www.microsoft.com/download/en/details.aspx?id=23415

Hope these scripts make your life easier as a SharePoint 2010 Developer and Administrator.

Cheerio!

Denali_thumb
Intro
Today I’m looking at the new TSQL function IIF that is available in SQL Server 2011 ”Denali”. IIF stand for “Inline IF”. IIF is a shorthand way for writing a CASE statement in TSQL.
MSDN Description
Returns one of two values, depending on whether the Boolean expression evaluates to true or false.
Syntax Format: IIF ( boolean_expression, true_value, false_value )
The first parameter is a Boolean expression e.g. Age > 21. The second parameter is return value if the expression is true and the third parameter is the return value if the expression is false.
TSQL Example
Basic example for IIF function:
DECLARE @age INT = 18;
SELECT IIF(@age > 21,'Allowed','Not allowed');

You can also have nested IIF. Nested IIF can only be nested up to a maximum level of 10. This is because the CASE statement has the same limitation.
DECLARE @age INT = 28,
        @firsttime BIT = 1;
SELECT IIF(@age > 21,
           IIF(@firsttime = 1, 'Free drink', 'No free drink'),
           'Not allowed');
 

Practical Example

My practical examples are using the AdventureWorks2008R2 database for Denali which is available here. Let look at a practical example for IIF function:
SELECT pdt.Name,
       IIF(SUM(piy.Quantity) < pdt.SafetyStockLevel, 'Low Stock', 'Normal Stock') AS 'Stock Status'
  FROM [AdventureWorks2008R2].[Production].[Product] pdt
  LEFT OUTER JOIN 
       [AdventureWorks2008R2].[Production].[ProductInventory] piy ON pdt.ProductID = piy.ProductID
 GROUP BY pdt.Name, pdt.SafetyStockLevel

As you can see the IIF function makes it allot easier to use than the CASE statement and helps to make your TSQL code smaller and more understandable. Let me know what you think about this function addition in SQL Server 2011 Denali or if you have any questions.

Cheerio!

Denali
Intro
As we all are waiting in excitement for the final release of SQL Server “Denali” I’m going to look at the new TSQL functions it brings for developers. The first function is EOMONTH. EOMONTH stand for “End Of MONTH”.
MSDN Description
Returns the last day of the month that contains the specified date, with an optional offset.
Syntax Format: EOMONTH ( start_date [, month_to_add ] )
Start date specify the date for which to return the last day of the same month. Month to add is an optional parameter to add months to the specified start date.
TSQL Example
Basic example for EOMONTH function:
DECLARE @start_date DATETIME = '08/10/2011'; 
SELECT EOMONTH (@start_date) AS Result; --Result: 2011-08-31 00:00:00.000

As you can see when I specify the 10 August 2011 the last date of the month is 31 August 2011. You can specify the start date as DATETIME or as a VARCHAR value. EOMONTH will do a implicit conversion of the VARCHAR to DATETIME.

Example to get next month last date:
DECLARE @start_date DATETIME = '08/10/2011'; 
SELECT EOMONTH (@start_date, 1) AS Result; --Result: 2011-09-30 00:00:00.000

Now by adding the optional parameter of 1 to the EOMONTH function you ask for the next month last date. As the example shows the result is 30 September 2011 for the input of 10 August 2011. If I change it to 2 then I will get the second month after the specified date.

Example to get previous month last date:
DECLARE @start_date DATETIME = '08/10/2011'; 
SELECT EOMONTH (@start_date, -1) AS Result; --Result: 2011-07-31 00:00:00.000

This example show how to get the previous month last date from the specified input date. You simply make the optional parameter minus. The input was again 10 August 2011 and the result for EOMONTH function was 31 July 2011.

Practical Example

My practical examples are using the AdventureWorks2008R2 database for Denali which is available here. Let look at a practical example for EOMONTH function:
DECLARE @begin_date DATETIME = '01/01/2007',
        @end_date DATETIME;
SELECT  @end_date = EOMONTH(@begin_date, 3); --Result: 2007-04-30 00:00:00.000

SELECT SUM(TotalDue) AS 'First Quarter Purchase Total' --Result: 145291.7959 
  FROM [AdventureWorks2008R2].[Purchasing].[PurchaseOrderHeader]
 WHERE OrderDate > @begin_date
   AND OrderDate < @end_date

In this example I calculate the first quarter purchase total for the year 2007. I specify a start date and use the EOMONTH function to calculate the last date of the quarter. Now it is easy to just sum up the TotalDue column for records between the begin date and end date.

As you can see the EOMONTH function makes it allot easier to get the last day of a month and it helps to make your TSQL code smaller and more understandable. Let me know what you think about this function addition in SQL Server 2011 Denali or if you have any questions.

Cheerio!

I found the perfect solution for UI mock-ups namely PowerMockup.There is a whole bunch of offline and online tools to create UI mock-ups. Using these tools are great, but clients are not always happy with these tools. Clients usually consider its something new they have to learn.

logo

With PowerMockup everything happens inside Microsoft PowerPoint. Client is happy because its a tool they know. You design inside PowerPoint and then just send the slides to clients and then they can view your designs. The clients can also move the elements around with or without having PowerMockup installed, but if they don’t have PowerMockup they cannot add new element.

The Toolset

Let me show you a couple of screenshots of PowerMockup. Firstly you need to go and download PowerMockup. You do get a trial period and the cost as of 27 August 2011 to buy is:

  • 1 User = $39.95
  • 5 Users = $119.95
  • 10 Users = $199.90

When you install PowerMockup you will see a new menu option in PowerPoint.

Menu

The Show Stencil Library button you have to click to view all the stencil items you can use for your UI mock-ups. The stencil library will appear on your right hand side of PowerPoint.

Stencils

The stencil library contains various items to use. The items are grouped as Custom Shapes, Containers, Graphics, Icons, Markup, Navigation and Text. You can create your own item and add it to the stencil library which you can export and import. PowerMockup also provides a nifty little search box at the top to quickly search for a specific item.

Here is an rough example design I did to show some of PowerMockup items.

BlogDesignExp

If you have a change, take a look at this great add on. You will definitely enjoy it and I had clients that enjoyed the experience of viewing their UI designs inside PowerPoint.

Cheerio!

trinity-logo

I found myself wondering around the Microsoft Research website the other day and found the Trinity project. Trinity is a graph database and computation platform over distributed memory cloud. Trinity currently have a release package of version 0.2 available for download. If you want to find out some more details visit the official site: http://research.microsoft.com/en-us/projects/trinity/default.aspx 

Key features of Trinity

  • Use Hypergraph Data Model
  • Distributed: Deployed to one more machines
  • Memory-based graph store with rich database features.
  • Highly Concurrent Online Query processing
  • ACI transaction support
  • Parallel graph processing system

The Interest

I never really took notice until I read through the documentation and understand the practical usage. Graph databases are used by all the big companies like Microsoft, Google and Facebook. A Graph database is a database that uses graph structures with nodes, edges and properties to represent and store information.

GraphDatabase_PropertyGraph

On Wikipedia you will find a whole list of Graph databases implementations: http://en.wikipedia.org/wiki/Graph_database

Where to know

You might ask yourself why do I write this entry about Trinity. Well, for starters all developers that use any Microsoft technology should take note of Trinity. Trinity can help to better structure information on your next project. I can see how Trinity can be used along side SharePoint and SQL Server. It would be interesting to see how you may be able to take existing SQL Server data to Trinity. I could also see how BI developers can take various data sources and structure the data inside Trinity to do their magic easier. I also believe that Trinity might be the solution service on Azure for graph database usage.

Since I’m a service integration person, I find it difficult to think how this will benefit any service integration project or be used along side BizTalk. I might be wrong?

I think Trinity has a bright future ahead. Hope Microsoft does not kill off this research project. Let me know what you think about graph databases and specifically the Trinity project.

 

Cheerio!

Denali

My latest presentation was at Microsoft Devs4Devs event. I discussed some of the new T-SQL functions that is available in SQL Server 2011 “Denali”. Firstly I want to thank Dave Russell from Microsoft for the opportunity. Also thanks must go to all the community members who attended the day and for your feedback.

My Slides is available here.

My T-SQL Code snippets here.

See you guys at the next community event.

Cheerio!

I had a very interesting experience try to setup Lync Server 2010 for my latest project. Using Lync Server 2010 with SharePoint 2010 environment. Very powerful combination for user collaboration.

Anyway, I got a very strange error in publishing my Lync Topology:

The existing topology identifies serverA.domain as the Central Management Store, but the topology that you are trying to publish identifies serverB.domain as the Central Management Store. The Central Management Stores must match before the topology can be published.

The white blotches on the images are server FQDN that I needed to hide.

Deployment Error

The reason for this might be that you specified the wrong FQDN and try to publish the Lync topology before. Firstly make sure you use the correct FQDN for the server that is hosting the Central Management Store.

Open up Lync Server Management Shell and type the following command to get the currently registered Central Management Store location:

Get-CsConfigurationStoreLocation

Command Get Store

To remove the registered Central Management Store location type in the following command:

Remove-CsConfigurationStoreLocation

Command Remove Store

After running these commands you can attempt to publish your Lync Topology again and see the success message.

Publish Success

Hope this help you with fixing Lync Topology publishing problems.

Cheerio!

Node.js has released an exe version that can be run on Windows to execute JavaScript on the server. The current version is 0.5.2. On the internet there are various articles on what Node.js is and how to use it.

Microsoft has recently partnered with Joyent to get Node.js running on Windows. Maybe in the future to run on the Microsoft Azure platform (My speculation).

To get started head over to the Node.js site and download the exe. Create an directory to put the exe.

Folder Directory

Create a folder next to the exe for you first Node.js project like Hello. Inside the Hello folder you create an server.js file to create your first web server application.

Here is an very basic example

Server Code

To run the Node.js example open up PowerShell and run the following command:

.\node.exe .\Hello\server.js

Run in Powershell

Now open your favourite browser and browse to the URL you specified in the source file.

Browser Display

That is it! Your first Node.js application running from Windows. Very easy.

Here are some additional links to read:

http://nodebeginner.org/

http://howtonode.org/

http://nodeguide.com/

https://github.com/joyent/node/wiki/

I will later follow up with a full blow HTML application.

Cheerio!

Here are a couple of tips and tricks for Oracle VirtualBox. At the time of writing this blog the latest version of VirtualBox is 4.1. The VirtualBox commands that follow is run in Windows but is more or less the same in Linux environments.

Tip 1 – Clone existing Virtual disk

In command line go to the path of where VirtualBox is installed because you are going to need access to the program VBoxManage. Windows command to change path: cd "C:\Program Files\Oracle\VirtualBox"

Command to clone an existing vdi file:

VBoxManage clonehd "path_to_source_image.vdi" "path_to_destination_image.vdi"

From version 4.1 there is an menu option to clone existing images in the VirtualBox Manager GUI.

Tip 2 – Clone existing Virtual disk to raw format

Cloning an existing image file to raw makes an copy of the image without any compression to the vdi format.

Command to clone to raw file:

VBoxManage clonehd --format RAW “path_to_source_image.vdi” “path_to_destination_image.raw”

Tip 3 – Convert raw image to vdi format

If you have an raw image you can convert it to the compressed vdi file format.

Command to convert from raw to vdi:

VBoxManage convertfromraw --format VDI “path_to_source_image.vdi” “path_to_destination_image.raw”

Tip 4 – Recompress an vdi file

After using an image file for an while it will keep allocating disk space if dynamic allocation is used, but you can reclaim some of that used disk space.

Inside the image you need to remove unused data and use an tool like CCleaner in Windows images to clear temp files.

Then you need to defrag the hard drive inside the image. Do defrag the hard drive twice. I use the tool Defraggler which is much better that the default defrag tool of Windows.

After that you can use the CCleaner drive wipe tool to clear free space only or use an similar tool. This will replace all clear space with 0 bits.

After that shutdown the image file and run the following command to recompress the vdi file: VboxManage modifyhd “path_to_target_image.vdi” compact

This command will remove all those 0 bits from the image file. After running the above command you will see that your vdi disk allocation has reduced. I have successfully shrink an vdi file from 70GB to 41GB.

Tip 5 – Host VMWare images

Firstly on you host you need to uninstall all VMWare tools.

Inside VirtualBox mount the VMWare image (.vmdk file) as an IDE, not SATA (the default when using the VirtualBox wizard).

Make sure the .vmdk filename does not contain '.' suffices.

After that you should be able to run the virtual disk.

 

Hope all these tips help you to run VirtualBox more efficiently and make you life easier. If you use any other VirtualBox command regularly let me know!

Cheerio!

I had the pleasure of presenting at the SA Dev workshop on 27 July 2011.Thanks to everyone who attended and please continue to support the local communities.

My discussion was based on Web application UI testing with open source tools and Visual Studio Testing tools. More specific I was covering AutoTest.Net for C# unit testing, QUnit for JavaScript testing and Web Tests and Load Tests in Visual Studio 2010.

Here is the links to my slides and demo application:

Web UI Testing Slides

World of Football Demo Application

Any feedback is welcome and thanks again!

Cheerio!

I recently worked on a project where I developed an WCF web services that is exposed via  https and net.tcp. The web services does all the database calls and business logic. Here are some lessons or tips for developing in WCF with net.tcp.

When I use the net.tcp channel to communicate to the web service I often get the following error:

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.

This is the default error message that you will get from WCF if something went wrong but the WCF channel does not know exactly what error occurred.

What to do when you receive this message.

  1. Increase the ReceiveTimeout and SendTimeout on the binding that is used by your web service to 5 min. The other timeout properties default values are 99.9% always correct. The 5 min is very big and will usually eliminate actual timeout issues.
  2. The usual suspects for the error is MaxBufferSize, MaxBufferPoolSize, MaxReceivedMessageSize, MaxArrayLength default size (65536) is to small. Increase them by adding a 0 at the end (655360) to see if the error disappear. Then by small increments reduce the size to find the correct value.
  3. If your web service method returns an big message or generic array or list with a big items count and big object graph you have to increase the value of the property MaxItemsInObjectGraph in the dataContractSerializer element. You need to create a Service Behaviour (Service side) and Endpoint Behaviour (Client side) with the dataContractSerializer element. You will then see the MaxItemsInObjectGraph property.
  4. To increase your communication between service and client you can switch the TransferMode in the binding from Buffered to Streamed.
  5. When you call the web service from an .Net client please avoid calling your code inside a using statement. Rather use try-finally where you can call close on the client object and if the communication channel faulted you can call abort on the client object.

These lessons will hopefully make your net.tcp development experience easier. If you have any further tips or lessons please leave a comment.

Cheerio!

Here is my talk that I presented at Devs4Devs. Thanks to Microsoft for the opportunity and thanks to the guys who attended.

At the bottom is the links to my presentation and sample code. Before you can use the sample you need to setup Windows Server AppFabric Cache and use the AdventureWorks Database.

Another note that the web service gets deployed to IIS when you build the project.

Here the links:

AdventureWorks Database

http://msftdbprodsamples.codeplex.com/

Sample Application

http://dl.dropbox.com/u/4406115/Devs4Devs%202011/AdventureService.zip

Presentation Slides

http://dl.dropbox.com/u/4406115/Devs4Devs%202011/WCF%20AppFabric%20Cache.pptx

Any feedback or questions are welcomed. Until the next talk!

I was busy going through some SQL Adapter walkthroughs in BizTalk 2010 and something very strange happened.

I was setting up my SQL Adapter, not the WCF SQL Adapter, and I come to the wizard screen where I need to select between Select or Stored procedure options.

I happily decided on the Select option. In the next screen you get a text area to write your SQL statement. Mine was just a simple select from a small table. I click the Next button and bang the whole wizard dialog disappeared. No SQLService.xsd was generated. I was so confused and though I did something wrong. I went over the steps like a crazy man.

Finally I restarted Visual Studio 2010 IDE and try again. After the restart everything just worked. I still don’t know why this happens. I don’t know if it is Visual Studio IDE or the SQL Adapter Wizard issue.

Lessons Learned – If something goes wrong in Visual Studio IDE for no reason then just restart the IDE and try again!

Cheerio!

Disqus