Wednesday, September 16, 2009

Come see the lovely Anne Marie in Bye Bye Birdie!

Hey Everybody,

Just wanted to let you know that my wonderful Wife, Anne Marie, is going to be performing in Bye Bye Birdie with the Arlington Players. She has a lead role in the production as the character of Rosie Alvarez and has several major song and dance numbers. I would love if you could all make it out. Performance dates and ticket information is below.

Bye Bye Birdie
Performance dates: September 18, 19, 20(m), 25, 26, 27(m), October 2 & 3, 2009
Click here to purchase your tickets online.

Wednesday, September 9, 2009

CRM Asynchronous Process Failure Settings

One of the things I do when setting up a CRM 4.0 server is modify the Recovery settings of the Asynch process. This process tends to have a lot of difficulty recovering if it loses the connection to SQL.

Figure 1

By default the service is set to Restart only on the first failure and the restart time is set to occur after 1 minute (Figure 1). The problem is that it typicaly takes a SQL server longer than one minute to reboot. In order to better ensure that you don't need to restart the service manually I typicaly change the Second failure to Restart the Service and set the Restart service after setting to something between 3 and 5 minutes (Figure 2).

Figure 2

By tweeking these setting you can help reduce the strain on your support folks by not always having to do a manual restart of this service every time they want to install patches on the SQL box.  Also your users won't be sitting there wondering why their workflows are not kicking off.

Tuesday, September 1, 2009

Copy data between rows in the same table

So here was my issue. I needed to copy some <binary data> from one row in a table to another row. I tried using the SQL Server Managment Studio but it does not allow you to copy and past binary information. Instead I used a UPDATE... FROM SQL statement.

Here is an example:

UPDATE LoadTestRun
SET LoadTest = b. LoadTest
FROM LoadTestRun, LoadTestRun b
WHERE LoadTestRun.LoadTestRunID = 4 AND b.LoadTestRunID = 1  

Here is the generic format:

UPDATE table
SET field = b.field
FROM table, table b
WHERE table.PirmaryKeyID = "Copy To ID" AND b.PrimaryKeyID = "Copy From ID"  

Creating a Visual Studio 2008 Results Repository

Learned a very important lesson. If you don't set up a results repository database before running a load test in Visual Studio you won't be able to pull up your reports later.

In this example only one machine was being used for load testing and SQL Express was installed as part of Visual Studio.

To create the results repository database in SQL Express follow the instructions below. If you want additional information or want to know how to create the database in SQL Standard check out Microsoft's instructions at

-Open a command prompt by going to Start -> Run and type in CMD and hit Enter

-Type: cd n:\Program Files\Microsoft Visual Studio 9\Common7\IDE

-Type: SQLCMD /S localhost\sqlexpress /i loadtestresultsrepository.sql

Moving a secondary site collection to a root site collection

I was recently tasked with migrating a secondary site collection to a new SharePoint server and making it the primary site collection.

Here is an example of what a URL looks for for a secondary site collection.

Here is an example of what a URL looks like for a root site collection:

You will notices that secondary site collection are placed by default under /sites/

Completing the Migration:

1. Run a backup of the site collection on the original server using STSADM. Here is the command line I used:

stsadm -o backup -filename "c:\backups\backup.bak" -url 

2. Copy the backup file to the new server where a new SharePoint instance is created and contains a new root site collection.

3. Run a restore of the site collection on the new server using STSADM. Here is the command line I used.

stsadm -o restore -filename "c:\restores\backup.bak" -url -overwrite 

Note: you have to use the overwrite parameter since you are restoring over the blank site collection created when SharePoint was set up.

4. Set up the search crawl rules in the Shared Service Provider to Include the new url.

Issue 1:

After the site was migrated I started clicking on things to see what would happen. Thing seemed fine until I clicked on a navigation heading. Highlighted in red below is an example of what I mean by "navigation heading."

For some reason all the navigation heading links still wanted to put /sites/collection/ into the url. I have a lot of sites and really didn't want to hand punch the fixes for all of these links so I created a SQL script to go out and change them. Below is the SQL I used. NOTE: Manipulating SharePoint databases can be bad. Also it's not supported by Microsoft, so if you do it, make a backup... please.

Author: Rick Wilson
Date: 8/27/08
Description: This script was used to update a MOSS 2007 primary site collection that was restored from a secondary level site collection (/sites/collection) backup. For some reason the Headings in the site navigation still wanted to use the '/sites/collection' part of the link. This script finds where that old link is being used and removes that section of it. 

How to Reuse:
-Update MOSS_Content MJMOSS to reflect the name of your content database
-Update the number 17 in the STUFF command to reflect the number of characters you want to remove from the URL in my cast there were 17 character is '/sites/collection'
-Update the '/sites/collection' after the LIKE operator to reflect the part of the url you want to remove. Make sure the keep the %% characters or the LIKE won't work.


UPDATE [NavNodes] 
SET [Url] = STUFF([Url],1,17, '') 
WHERE [Url] LIKE '%/sites/collection%' 

Issue 2:

The sites that were created for this collection used the default SharePoint template. The only modification to the sites was the logo in the upper left hand corner which is set under the site settings. There were about 45 sites that had been created and again I wasn't feeling like manually changing the link for every site. Here is the SQL I wrote the change the logo for me.


Author: Rick Wilson
Date: 8/28/08Description: This script was used to update the Site Logo on SharePoint sites.

How to Reuse:
-Update MOSS_Content MJMOSS to reflect the name of your content database.
-Update the url after SET to the new url you have for your logo.
-Update the url after the WHERE operator to the old site logo that was being used.

SET [SiteLogoURL] = ''
WHERE [SiteLogoURL] = '' 

Changing the MOSS Service Account.... ughhhhh

Bad Idea... Changing the password of the SharePoint service account used to set up and run everything SharePoint. If you have done this read the next paragraph before touching your keyboard again.

Worse Idea... Trying to change the password back to what it was, but when confronted with domain password policies that do not allow you to change the password to one you have used recently you delete the user. Then you go in and recreate the user and assign him the old password. IMPORTANT: If you go into the Active Directory Users and Computers under the Administrator tools and you are a domain administrator you can reset the password of any user to whatever you want. Domain policies be damned. So if you have not deleted the service account yet just change the password in the way I just described. Then reset your sharepoint machine and be thankful that you don't have to read the rest of this article.

Now lets say you decided to do these two things..... ughhhh. Why doesn't recreating the user in Active Directory and setting it to the old password work. Because each user account is given it's own Security Identifier also called a SID. The SID is unique every time you create a user. That means even though you created the user with the same name the SID is going to be new. Think of it like looking at identical twins, sure they may look exactly the same from far away but get close enough and you start to find some diferences. Why is that important???? Because SharePoint, SQL, and just about every other Microsoft server software identifies users by their SID and not their user name. This is especially true for SharePoint.

Here is how to fix your problems:

-Create a new active directory user. call the user something differenct than what you called you original SharePoint service account. In your naming also try to change it to something that won't confuse you as to which one is the new and which was is the old users.

Example: If you original SharePoint service account was call MOSSService call the new one something like SharePointService

-Add your new user into the Local Administrators security group on the box that is hosting SharePoint.

-Add your new user into the Local Administrators security group on the box that is hosting SQL.

-Open the SQL Server Management Studio and add in your new user as a login. Then assign the following SQL roles to that user: securityadmin, dbcreator

-Now go to the linked KB article and follow the insructions. Make sure that you substitube the new SharePoint service account information for the DomainName\UserName and password fields.

Still Having Trouble?

In my specific instance of this happening I still received the "Unknown Error" message from SharePoint when trying to access the site. So here is what I had to do inaddition to everything above.

-Log into the SharePoint machine using your new service account.

-Hope you have a recent STSADM backup of the site.

-Complete an STSADM restore of the site.

stsadm -o restore -url -file C:\Temp\Backup.bak -overwrite 

-Run the following command you ran previously in the KB article:

stsadm -o updatefarmcredentials -userlogin DomainName\UserName -password NewPassword 

-Reset IIS by typing this into the command promp:

iisreset /noforce 

-Run a second command that you ran previously in the KB article:

stsadm -o updateaccountpassword -userlogin DomainName\UserName -password NewPassword -noadmin 

-Open the IIS (Internet Information Services) utility from the Administrator tools and ensure that all the Application Pools have the correct user assigned. In this case our new user was called SharePointService. If you still see the old user there change the application pool.

-Reset IIS by typing this into the command promp:

iisreset /noforce 

If all else fails get in contact with me and expect to pay a lot of money to fix it.

Register Bamboo Calendar Web Part

I recently downloaded the Bamboo Calendar Plus Web Part v2.5. I ran the setup file and installed both the Calendar Plus Web Part and the Bamboo License Manager v2.7. Here are the issues I ran into:

Firstly, you will need to be connected to the internet to get the registration program to correctly activate the web part. Otherwise you will have to activate by e-mail or phone.

Secondly, the Calendar web part .dll is not located in the GAC so I had to go out and search for it. The .dll was located in <System Drive>:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin\Bamboo.CalendarViewExtended.dll. In my case my VirtualDirectory was 80 but for others this may be different. Also if you installed the web part into multiple web application you will also need to activate the product by located the .dll under the other VirtualDirectories folders.

Then after selecting the .ddl file in the License Manager I entered the product code. I accidently entered an incorrect product code. Then came the BLUE SCREEN OF DEATH from Windows Server 2003. I don't know about you but that is scary.

After my server restarted I then ran the License Manger again... this time using the correct product code. I was then able to activate the .dll file located in the multiple web application I installed it in.

Get SPUser Information for the Document Creator

While working on creating a SharePoint 2007 event handler I needed to get the login name for the creator of the document I was trying to update. This is the code I snagged from a blog article which worked.

SPSite oSite = new SPSite("Your site URL");
SPList oList = oSite.OpenWeb().Lists["Your list name"];
SPListItem oItem = oList.GetItemById("Item ID");
string userValue = oItem["Created By"].ToString();
int index = userValue.Index Of(';');
int id = Int32.Parse(userValue.Substring(0, index));
SPUser itemCreator = oSite.OpenWeb().SiteUsers.GetByID(id);  

After using that information I could then call:


Which produces the users login name in the following format "DOMAIN\User".

Grouping Articles By Month

After creating a blog site I wanted to show a webpart that grouped the posts by month. To accomplish this I added a calculated field to my Posts list and used the following formula:

 =TEXT(Published,"yyyy - ")&TEXT(Published,"mm")&TEXT(Published," (mmmm")&TEXT(Published," yyyy)")




You can substitute Published for any other date field within your Posts list. When calculated it displays the date in the following format "2007 - 05 (May 2007)"

After completing the calculated field I added a new Posts webpart to the page. I then modified it to the show the "All Posts" view. Then I modified that view to group by the calculated field I created.

Note: It is important to change the view of the webpart to from "" to "All Items" after you add the webpart. Otherwise when you uncollapse the grouping the titles and other text will have the same formatting as the blog posts. This means your titles will show up HUGE.

Tool to embed HTML object directly into SharePoint content

Check out this cool Rick Text Editor add-in that will allow you to embed html such as YouTube and Flash videos. Finally something on codeplex that works!

After installing the tool you will now have a new button on your rich text editor.

Click it and you will get a pop-up window into which you can enter your code.

Thursday, August 27, 2009

Dynamics CRM Demonstration Tools (Data Generator)

When creating demo environments for sales presenations I like to add a lot of test data to my systems and make it relevant to the custom to which I'm presenting. Microsoft released a tool called "Microsoft CRM Demonstration Tools" which you can download here.

This tool has several useful features:
-Data Generator
-Date Mover
-Dependent Picklist Creator
-Generate Emails
-Generate Entity Icons
-Site Map Editor
-String Replacer

The tool I use the most is the data generator. This allows me to create XML files which will automatically generate entity records in my demo system.

I first go into the demonstration tools and generate an XML file with all the fields I want to populate and put in at least one test value for each field to ensure that I get my data formatted right.

Next I need to get some sample data. For some of it I look around the internet but for the basics I use a great OpenSource tool called GenerateData which you can install on any web server using PHP and MySQL, or you can use their online instance of the tool. This allows you to generate test data for names, addresses, random words, dates, and more.

I usually edit the XML in Visual Studio and reformat it into a more readable XML format which also allows me to expand and contract the nodes. After you load the file in just go to Edit -> Advanced -> Format Document

The problem with editing the document in Visual Studio though is that the Demonstration Tools will not accept an XML file that has any line breaks for paces between the tags. This is when I crack open my favorite text editor called TextPad. I past and then do a select all of the XML data in TextPad. I then go to Edit -> Joint Lines (Ctrl+J).

Next I go to Search -> Replace (F8) and look for "> <" and replace it with "><" to remove the space between the tags.

Finally I try clicking on the line directly beneath the text to ensure that there is no line break after the text. After I save all the info I go back into the Demonstration Tools -> Data Generator, click the Open... button and select the file I created. Ensure that your data is the way you want it, choose the number of records to generate, and click Generate Data. You now have a customized record set to show your customer.

On a final note I use differencing disks on my VPC to quickly set up multiple test/demo environments. If you only use one VPC but you want to delete your old test data before you load in new data you can this tool to create batch delete jobs without using the SDK.

Friday, August 21, 2009

No "Edit Page" link for standard aspx page in SharePoint

Many times user create aspx pages within SharePoint designer and then add web part zones to them so they can add data. There are several problems with this, the first being that you will never get a link for "Edit Page". This means you have to open the page in SharePoint designer every time you want to do a modification.

There is a way to get around this. Add the follow to the end of the url : ?PageView=Shared&ToolPaneView=2


You will now be able to see the Edit drop down on all the web parts although it may look a little wonky.

Fix Error "Microsoft Dynamics CRM Mail Merge is already running"

When trying to do multiple mail merges I many time get a pop-up error stating "Microsoft Dynamics CRM Mail Merge is already running". Here is how to fix it.

Close out of Internet Explorer, Word, and Outlook. Yah I know it sounds easy but It took me a while to figure out since I kept Internet Explorer open to seach on how to fix the problem :)

You can also find out more information on how to troubleshoot common CRM 4.0 mail merge problems in this Microsoft Knowledge Base article.


CRM 4.0 - System Jobs always stuck in "Waiting"

I had just re-isntalled CRM so that I could set it up as an IFD (Internet Facing Deployment) server. Also CRM is set up through an ISA firewall and using SSL. I had to update several fields in the MSCRM_CONFIG database just to get everything to work correctly. I will post another entry with how to get everything workign in IFD mode through ISA correctly.

Now here is what happened.... So one day I was running some test marketing campaign e-mails from CRM and I noticed they were not being sent out. I checkout out the system job page and noticed they were all stuck in the Waiting condition. I tried moving them to Resume but they would just go back into the Waiting condition.

I looked around the web and found out that apparently I had missed a database field update that was not included on the website I found that talked about IFD setup. It's "AsyncSdkRootDomain" and can be found under the DeploymentProperties table.

Here is how to fix it. I have pieced this together from several other people who's pages are linked below.

-Run this SQL command to see your current settings:

Select NVarCharColumn
from DeploymentProperties
where ColumnName='ADSdkRootDomain'
or ColumnName='ADWebApplicationRootDomain'
or ColumnName='AsyncSdkRootDomain';

-You will most like get results that look like this.. where <server> is your server name, and $lt;port> is the port number you are running the CRM website under:


-Run the follow SQL script to update the value for "AsyncSdkRootDomain". Make sure to replace with your server name and with the port number you are running your CRM website under.

Update DeploymentProperties
Set NVarCharColumn = '<server>:<port>'
Where ColumnName = 'AsyncSdkRootDomain';

-Now restart IIS (open a command prompt and run IISRESET)
-Restart the CRM Async service on the server.

You should be back up and running smoothly.

Here are the articles I read that gave me all the info in this article:

Set up CRM 4.0 Authentication in ISA Server

So you have CRM 4.0 and ISA server. You also want to use the IFD (Internet Facing Deployment) feature of CRM. Well here is what you need to know. This information helped me and I will update and add to it soon....

Taken from original posting:

1. Enable just Basic HTTP Authentication on the Web Listener in ISA
2. In the Authentication tab of the Firewall Policy for the CRM, select "No authentication, but client may authenticate directly".
3. In the To tab of the Firewall Policy for the CRM, make sure "Foreward original host header" and "Requests appear to come from the original client" is selected.
4. In the Users tab of the Firewall Policy for the CRM, make sure it is "All Users" Instead of "All Authenticated Users" (CRUCUAL STEP)
5. Apply the settings in ISA.
6. Now go to "Internet Settings" on the client computer, and navigate to the security tab.
7. Click custom level on the trusted site, and scroll to the very bottom and select “Automatic logon with current user name and password”.
8. Add the CRM url to the trusted sites without the prefix (aka. not and just
9. Navigate to and type in your login credentials. AND CLICK REMEBER PASSWORD.
10. Run the configuration wizard, and it should work

Hope this helps, I was struggling with this for days and nights.

E-mail me at This e-mail address is being protected from spambots. You need JavaScript enabled to view it if you guys run into any more issues.


Blank Page With JavaScript Error 'Object Expected'

I had just installed reporting services and the reporting services connector. Suddenly my CRM web client is only showing me a blue screen and will not go to the main page. My office neighbor could see the screen but no images were being displayed.

There was a javascript error that said the following:

Error on page
Line: 194
Char: 1
Error: Object expected
Code: 0
URL: http://localhost:5555/orgname

Here is what I did to fix:

-Go into the IIS Manager and select properties for the CRM Website.

-Remove Anonymous access from the site.

-Apply the properties

-Go back in and turn Anonymous access back on and re-apply the change.

Now navigate back to your site. Voila! It worked for me.

cPanel - Backup

After having my e-mail accidentally removed and charging me $75 dollars to have it restored I created a backup script to download the automated cPanel backups. I found a lot of other backups on the internet that used PHP and Perl to do this but since I was using cPanel proxy they would not work.

This script can be set up using windows scheduling service. I have it run one a week. Additionally using the /d switch and the 'backups' setting you can make it delete old backups. Eg. If you want to keep the 3 most recent backups then set the 'backups' equal to 3. Please let me know if you have any comment or suggestion for this script.

Click here to download

cPanel/Horde - Proxy

If you are like me and work in the corporate world you are restricted to ports 80 and 443. I found this great php program that will allow you to run cPanel and Horde on port 80.

Click here to go to the developer’s site and download the program

Expand a VHD drive and partition - "How To & Video"

When creating a virtual hard drive in Microsoft Virtual PC the default drive size is 16GB. This seems like a lot of space but it quickly dwindles as you do development. Typically I set the drive size to something much larger if I'm creating the virtual machine from scratch. Unfortunately many times I use SYSPREP images to speed up the process and these images are set to the default 16GB. In order to expand these drives out there are two tools which you need.


The first tool you will need is VHD Resizer. This tool allows you to expand the size of the VHD file and also change it from fixed size to dynamic or vice versa.

Download VHD Resizer (requires free registration)

The second tool required is the Gparted LiveCD. This is an open source tool that can be used to increase the size of the partition on the drive after you have increased the VHD size.

Download GParted LiveCD ISO Image

GParted Homepage


Excel Services Compatibility Checker

A while back I had a customer who wished to use Excel Services to do some project reporting dashboards. After initially uploading the Excel file and configuring Excel Services accordingly I tried opening it with the Excel Web Access web part. The follow error appeared on the screen.

This and many other things within Excel that can cause similar errors including adding images or query tables. If you are using one excel sheet to populate several dashboard it can extremely frustrating when a simple change to your Excel file causes them all to display an error screen.

After searching around for a while I came upon the Excel Services Compatibility Checker. This tool is available as a download and it allows you to determine what items within your Excel file will cause Excel Services to error out before you upload the file. Thus avoiding the annoyance of all your dashboards breaking because someone though it would be cool to add an image to the file.

Click here for the Excel Services Compatibility Checker download page.
Click here for information on the most recent build of the tool.

Wednesday, August 19, 2009

SQL Server Integration Services (SSIS) Development Tips

Here are some SSIS devlopment tips and tricks.

-Before debugging your solution re-save it or Visual Studio is more likely to crash.
-Editing package configuration documents in Visual Studio (Click Here)
-Making SSIS packages portable. (Click Here)
-more to come...

Monday, August 17, 2009

CRM 4.0 Development Tips

Here are a list of items to think about when developing.

-Add an informaiton bar to the form form. (Click Here for Instructions)
-Update SiteMap Description field. These descriptions are displayed in the Outlook client.(

-If you re-deploye a custom workflow activity dll you may need to delete and recreate those steps in the workflows which were using it.
-Web Services: When you are in the Execute method of a workflow you do not need to specify all the connection items to connect to the CRM web services. All that information is already there you just need to create a new instance of the service. (Example)

CRM Tools Blog: This site offers a collection of tools that I find very useful and time saving when developing in CRM.