Wednesday, July 17, 2013

SharePoint 2010: Rename a SharePoint 2010 farm

To rename an existing SharePoint 2010 farm you can use this PowerShell command:
Rename-SPServer [oldServername] -Name [newServername]
Before you change the host name of your servers, you will need to use this command!

The same thing can be achieved by using the stsadm command:
stsadm -o renameserver -oldservername [oldNAME] -newservername [newNAME]
The stsadm command can be used before or after the servernames have been changed.

Monday, July 15, 2013

SharePoint 2010: FSSPUsernameFilter.dll failed to load

While I was restoring my SharePoint farm I got this little error:
"The HTTP Filter DLL 'C:\Program Files\Microsoft Forefront Protection\FSSPUsernameFilter.dll' failed to load. The data is the error."

"The data is the error" sounds like something straight from The Matrix, but don't worry, we're still talking about Microsoft Tools. So how do you fix that?

Solution A)
1. Check which account is used to run the IIS pool for your SharePoint WebApp.
2. Check the permissions on your Forefront installations directory and grant full access to the mentioned account.
3. Maybe you also need to grant full access to the "FSSUPUsernameFilter.dll". But this is something you have to test for yourself. Sometimes it works without permissions on file level, other times it did not work for me.

Solution B)
1. Remove the filter:
2. Deactivate the anti-virus scan:

Depending on your users, the second solution might not be the smartest idea, but at least you can get the farm running while you are maybe reinstalling Forefront.

Solution C)
Reinstall Forefront. This is your last resort. Make sure that every Forefront file is removed and install the application again.

SharePoint 2010: Could not load all ISAPI filters

While I was restoring my SharePoint farm, I came across this error:
"Could not load all ISAPI filters for site 'SP-WebAPP'. Therefore site startup aborted."

To fix this issue simply run command "aspnet_regiis.exe -i".
You will be able to find that file in the "C:\WINOWS\Microsoft.NET\Framework64\v2.0.50727" directory.

Here's the MSDN article.

Tuesday, July 9, 2013

Infopath 2010: Delete a data binding

Just say you got a binding on a field in Infopath and you want to remove it. Here is how you can do it:

XPathNodeIterator statusDelete = xnMyForm.Select("/my:myFields/my:statusField", ns);
int count = statusDelete.Count;
if (statusDelete.Count > 0)
XPathNavigator delStatusDelete = xnMyForm.SelectSingleNode("/my:myFields/my:statusField", ns);

I simply use XPathNodeIterator, pick the field i want to remove, check if it exists und delete the first version of it. Because I can't use .DeleteSelf() I have to use XPatchNavigator for this part.

Wednesday, July 3, 2013

SharePoint 2010: SQL Server was not found after moving database

Another really entertaining error I got this week while using "Configuration Wizard", was this little gem:
Failed to register SharePoint services.
Now you might think: Wait a second! We already have a solution for that!
I thought so too, but after closer inspection of this error, I realized: My SQL server was missing! Well, not excactly missing, because he was running.

The scenario I encountered was this:
I had to switch my development system, got a new server name and forgot so stop every service and cut loose all ties between SQL and SharePoint. And I also made the mistake to transfer every database from my old system to my new system.

The solution:
Open "SQL Server Management Studio" and rename your existing SharePoint config database. The Configuration Wizard will now search for the old name, but will not find it and prompt you to create a new database. Problem solved.

Tuesday, July 2, 2013

SharePoint 2010: An exception of type System.Security.Cryptography.CryptographicException was thrown

While running the "Configuration Wizard" I encountered another problem.

"Exception - Failed to create the configuration database. An exception of type System.Security.Cryptography.CryptographicException was thrown. Additional exception information: The data is invalid."

Not that good, but also not that hard to fix.

The first thing you can try is:
Go to "%commonfiles%\Microsoft Shared\Webserver Extensions" and check the folder "14". Right-click on it, select properties and then click on the security tab. There you have to give the account "NETWORK SERVICE" full access.

If that didn't not help, you can try another solution:
Open your registry, go to "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/Web Server Extensions/14.0/Secure/FarmAdmin" and remove the registry entry there.

One time, the first solution fixed my problem, another time I needed both.

Monday, July 1, 2013

SharePoint 2010: Failed to register SharePoint services

After I was installing a new SharePoint farm, I got this message while running the "Configuration Wizard" (step 5):

Failed to register SharePoint services

I tried to restart the system, stopp and start the services again, but nothing worked. In the end I had to delete some entries in the registry.

1. So, click on "Start", "run" and type in "regedit". 
2. Now follow this path: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/Web ServerExtensions/14.0/WSS/Services 
3. There I started to delete every failed service that poped up.