About Me · Send mail to the author(s) E-mail · Twitter

At GROSSWEBER we practice what we preach. We offer trainings for modern software technologies like Behavior Driven Development, Clean Code and Git. Our staff is fluent in a variety of languages, including English.

Feed Icon


Open Source Projects


Blogs of friends

Now playing [?]

Error retrieving information from external service.


Page 1 of 2 in the SharePoint category Next Page

Migrating SharePoint Content Databases To A New Farm While Keeping Security Settings

Posted in .NET | SharePoint | SQL Server at Saturday, 25 April 2009 16:40 W. Europe Daylight Time

The server this blog is hosted on was upgraded recently, i.e. is now run on a new dedicated server. Actually, next to this blog there’s a lot more going on. We, a bunch of geeks, are self-hosting mail, web sites, blogs and some collaboration tools like SharePoint (Windows SharePoint Services, in our case). Yeah, SharePoint, a true beast in and of itself. I can’t tell you how much I do not miss developing software for it and setting up customer sites.

I wanted to make the move to the new server as smooth as possible for our SharePoint users. Because we do not use Active Directory to authenticate our users, we obviously had to migrate the SharePoint user accounts manually. That is, re-create each user on the new server giving them a random password and communicate the change.

Moving a SharePoint site is surprisingly pretty well documented on TechNet, but won’t tell you about one important aspect: When you move the site to a new farm and the site does not use Active Directory, you will have to set up security anew.

Why? Because SharePoint matches user accounts by their SID, a value that is unique for each user account, even across machines: OLDMACHINE\foo’s SID is different from NEWMACHINE\foo’s SID. Burdening the four site collection administrator with this task is simply a no-go.

During my research how to work around that I found the Dustin Miller’s excellent post “Fix those SIDs”. It describes the process of massaging a SharePoint site collection database to replace old SIDs with the account SIDs of the current machine. I’ve extended it a bit, because I also decided to rename the SharePoint Search account while moving to the new server (note the extra REPLACE in line 11).

DECLARE @login nvarchar(255), @SystemId varbinary(512)

SELECT tp_Login, tp_SystemID FROM UserInfo WHERE tp_Deleted = 0

OPEN curUsers
FETCH NEXT FROM curUsers INTO @login, @systemid

    DECLARE @newLoginName AS nvarchar(255) = REPLACE(REPLACE(@login, 'OLDMACHINE', 'NEWMACHINE'), 'spsearch', 'sharepoint-search')
    DECLARE @newSID varbinary(85) = SUSER_SID(@newLoginName)
        PRINT 'Resetting user ' + @login + ' to new login ' + @newLoginName  + ' with SID '
        PRINT SUSER_SID(@newLoginName)

        UPDATE UserInfo
        SET    tp_SystemID = SUSER_SID(@newLoginName),
               tp_Login = @newLoginName
        WHERE CURRENT OF curUsers
    FETCH NEXT FROM curUsers INTO @login, @systemid

CLOSE curUsers

After the script ran, take a look at the UserInfo table and SELECT rows that still contain OLDMACHINE in the tp_Login column. This helps you get a quick overview of what accounts have been missed during account re-creation.

As an extra step, I found it appropriate to update the site’s user entry as well (the account name that shows up in the site’s user list when no full name is given) to reflect the new machine name.

UPDATE    [AllUserData]
SET       [nvarchar1] = REPLACE(REPLACE([nvarchar1], 'OLDMACHINE', 'NEWMACHINE'), 'spsearch', 'sharepoint-search'),
          [nvarchar2] = REPLACE(REPLACE([nvarchar2], 'OLDMACHINE', 'NEWMACHINE'), 'spsearch', 'sharepoint-search'),
          [nvarchar3] = REPLACE(REPLACE([nvarchar3], 'OLDMACHINE', 'NEWMACHINE'), 'spsearch', 'sharepoint-search')

Batch Installing SharePoint Solution Deployment Packages (WSPs)

Posted in SharePoint at Friday, 11 April 2008 21:57 W. Europe Daylight Time

Because I needed to install the 20 free SharePoint Application Templates twice this week and Microsoft does not dare to include a batch installer... The batch below installs all *.wsp files in the current directory and deploys them immediately. Hopefully this saves you some time.

@echo off
for %%f in (*.wsp) do (
    echo File %%f
    "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addsolution -filename "%%f"
    "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o deploysolution -name "%%f" -allowgacdeployment -immediate -force

"%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o copyappbincontent
"%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o execadmsvcjobs

Microsofts Übersetzungen

Posted in SharePoint at Thursday, 30 August 2007 18:50 W. Europe Daylight Time

Übersetzung von Software ist kein einfach zu beackerndes Feld: In einem ersten Schritt muss die Anwendung für die spätere Übersetzung vorbereitet werden (Globalisierung). Das heißt, hartcodierte Zeichenketten für Fehlermeldungen oder landestypische Formate für Datumsangaben (z. B. "dd. MM. yyyy") sind im Quellcode tabu. Allerdings beginnt erst danach die "richtige" Arbeit, sprich die Übersetzung von Inhalten (Lokalisierung). Gerade bei umfangreichen Produkten finden sich eine ganze Reihe von Zeichenketten, Bildern und sonstigen Ressourcen die es zu lokalisieren gilt. Wer seine Anwendungen mit dem Ziel der einfachen Übersetzbarkeit entwickelt, weiß welchen Aufwand man treibt.

Ich vermute, dass Übersetzer in der professionellen Softwareentwicklung oft schon vor der endgültigen Fertigstellung des Produkts an der Lokalisierung der Inhalte bzw. der Hilfetexte arbeiten. Dabei kommen spezielle Lokalisierungstools zum Einsatz (siehe dazu diesen Artikel bei dotnetpro) in denen die endgültige Programmoberfläche u. U. nicht zu sehen (da nicht fertiggestellt) ist.

Keine leichte Aufgabe also. Mir fallen in letzter Zeit häufiger Fehler in Microsoft-Produkten auf, die meiner Meinung nach in die Kategorie "nicht mitgedacht" eingeordnet werden können. Einer dieser Fehler ist mir heute bei der Arbeit mit dem Microsoft Office SharePoint Designer 2007 ("what a mouthful" würden Englischsprachige jetzt sagen) untergekommen:

Tunesischer Dinar

Der Screenshot zeigt die Synchronisierungsfunktion beim Abgleich von SharePoint-Webseiten mithilfe des Importassistenten. Beim Halten der Maus über der Schaltfläche "Anhalten" erscheint "Tunesischer Dinar" als Tooltip. Sehr gelungen!

Im SharePoint/WSS-Server selbst finden sich daneben der "um"-Bug und der "Speicherort" für Termine, der sicherlich nur "Ort" heißen sollte.


Als ärgerlich erachte ich ebenfalls inkonsistente Hilfetexte, die offensichtlich erstellt wurde als die Anwendungsoberfläche noch nicht fertiggestellt war. Teilweise in Englisch gehaltene Screenshots sind verkraftbar, warum aber wird in diesem Hilfetext zunächst eine Variable Neues Aufgabenelement erstellt, später aber als document_status referenziert?

Office 2007 File Icons for Windows SharePoint Services 2.0 and SharePoint Portal Server 2003

Posted in IIS | Office | SharePoint at Saturday, 16 December 2006 20:30 W. Europe Standard Time

As you probably know some applications of the 2007 Office System introduce new file extensions. Word 2007, Excel 2007 and PowerPoint 2007 save their data in a new XML-based format by default. To distinguish between the old (binary) and new (XML) file formats Microsoft has created some four-letter file extensions like docx for Word documents. The XML files are stored in a zip container, if you rename such files to have a zip extension, you can peek inside them with WinZip and other zip-aware tools.

If you upload documents created with the 2007 Office System to your WSS 2.0/SharePoint 2003 server you will see that the file icon in front of the file name is missing. This is because those versions of SharePoint essentially are not aware of the new file types. You'll have to register the new file types with SharePoint and provide icons for them.

    The archive contains 16x16 icons in 32-bits color-depth for all new file types. You'll also find five subfolders with the icons saved in the GIF, JPEG and PNG formats (GIF and JPEG with light and dark backgrounds for transparency). The Photoshop Automation.jsx script can be used to create all five images on the fly using Photoshop's scripting functionality - be sure to install the Photoshop ICO plugin first.
    If you want to extract other icons, these are embedded resources of the executables inside the C:\WINDOWS\Installer\{90120000-0030-0000-0000-0000000FF1CE}\ folder.
  2. Choose an image format appropriate to your SharePoint style – I went with the images from the gif-light folder as these suit the default SharePoint theme.
  3. Copy the images to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\IMAGES\ folder on your SharePoint server.
  4. Open the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\XML\docicon.xml file with an editor. Add the following lines under the ByExtension element. Be sure to change the file extension (Value attribute) based on the image format you chose.
    <Mapping Key="docx" Value="docx.gif" EditText="Microsoft Office Word" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="docm" Value="docm.gif" EditText="Microsoft Office Word" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="dotx" Value="dotx.gif" EditText="Microsoft Office Word" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="dotm" Value="dotm.gif" EditText="Microsoft Office Word" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xlsx" Value="xlsx.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xlsm" Value="xlsm.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xltx" Value="xltx.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xltm" Value="xltm.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xlsb" Value="xlsb.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="xlam" Value="xlam.gif" EditText="Microsoft Office Excel" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="pptx" Value="pptx.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="pptm" Value="pptm.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="potx" Value="potx.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="potm" Value="potm.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="ppam" Value="ppam.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="ppsx" Value="ppsx.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
    <Mapping Key="ppsm" Value="ppsm.gif" EditText="Microsoft Office PowerPoint" OpenControl="SharePoint.OpenDocuments"/>
  5. Reset IIS by running iisreset.exe.
  6. You can test if the new icons work if you download this zip with sample documents. Upload the files to a document library. If everything worked, you should see something like this:
    Office 2007 sample documents with icons in SharePoint

The next step would be to let SharePoint index the new file types making them searchable. Unfortunately there are publicly available IFilters available yet. Even the new Windows Desktop Search 3.0 doesn't crawl docx and the like. Update: It appears there's a configuration issue with Windows Desktop Search on my machine as WDS just does not crawl my documents folder.

Another Update: A reader asked why documents of the Office 2007 flavor are handled differently by SharePoint. Instead of opening a docx in Word when you left-click the document's name, the browser shows a download dialog. Old-style doc files will be opened instantly by Word (assuming you're using Internet Explorer and have the SharePoint collaboration components installed).

Currently I have no idea how to make the new file types handled the same as the old files. After all, I'm no SharePoint expert. A workaround for this issue is to click the triangle on the right to the document name and choose "Edit in Microsoft Word" from the drop down list of actions.

Another thing that may help is adding the MIME types for Office 2007 documents in IIS. Without them, SharePoint serves 2007-style file types with the "application/octet-stream" generic content-type. The easiest way to do this is stopping IIS and editing the metabase XML file (C:\WINDOWS\system32\inetsrv\MetaBase.xml) using a text editor. Search for the <IIsMimeMap Location="/LM/MimeMap" …> element and append these lines to the MimeMap attribute:


Be sure to add one MIME type per line. This will make the MIME types globally available on the server. After saving the metabase file, restart IIS.

Now Playing [?]: Zoot Woman – It's automatic

SharePoint Does Not Index PDFs by Default

Posted in SharePoint | Office at Tuesday, 07 March 2006 22:43 W. Europe Standard Time

PDF IconRather by accident I found out that SharePoint Portal Server 2003 does not index PDF documents by default. This may be because PDF is a non-Microsoft format. But PDFs are commonly used when exchanging documents in cooperative work environments like SharePoint  Team Sites.

The steps to take to enable search for PDF documents on a SharePoint Server are pretty straight forward and extensively described. If you are looking for the icon file that is neither included in the PDF IFilter setup nor in SharePoint itself, simply issue an image search.

Now playing: The Cinematic Orchestra - Everyday - All things to all men (feat. Roots Manuva)

Page 1 of 2 in the SharePoint category Next Page