Posted By: Eric Ledoux, SLK Development Manager
SharePoint Learning Kit provides a user interface, integrated into SharePoint Central Administration, for configuring a SharePoint site collection for use with SLK. The association between a site collection and SLK data is called a "SLK mapping". (In the SLK software development kit (SDK), it's called a "SlkSPSiteMapping". "SPSite" is SharePoint's internal term for "site collection", which is a set of SharePoint Web sites.)
A SLK mapping consists of the following information:
SLK mappings are stored in the SharePoint configuration database when you use the "Configure SharePoint Learning Kit" page in SharePoint Central Administration.
Question: How do you remove a mapping? How do you "unconfigure" SLK?
You may think that uninstalling SLK (i.e. "retracting" and "deleting" the SharePointLearningKit.wsp solution) will remove mappings, but that's not the case. (That's a good thing—it means you can upgrade to a new version of SLK software without losing your assignments, assuming the new version is compatible.)
You may think that deleting the SLK database will remove mappings. That won't work either, since the mappings are stored in SharePoint's configuration database, not the SLK database.
The easiest way to remove a mapping is to use the "slkadm.exe" console (command-line) application provided with SLK. This tool is modeled after "stsadm.exe", a console application included with SharePoint as a way to configure SharePoint from the command line or from batch files. slkadm.exe is included in the SLK-Install-1.0.nnn-ENU.zip file (where nnn is the build number).
Here's an example of a simple use of slkadm.exe within a Command Prompt window on a SharePoint front-end server. Yellow text is what I typed. (This example assumes you've copied the contents of SLK-Install-1.0.nnn-ENU.zip to C:\Install, and you've installed SLK.)
C:\Install>slkadm -o enummappingshttp://ericle1/districts/bellevue (696119ae-dd2f-42fb-b1c2-f57cef818553) --> Server=ERICLE1;Database=SharePointLearningKithttp://ericle1 (936ca441-9a5a-4cbb-b772-185d011fba5c) --> Server=ERICLE1;Database=SharePointLearningKitC:\Install>
Above, "-o enummappings" means "perform the operation: enumerate mappings". The output from slkadm.exe is the list of mappings that are currently on my machine. In the example above, there are two mappings:
These two mappings were created by me using the Configure SharePoint Learning Kit page (in SharePoint Central Administration) twice: once to configure "http://ericle1/districts/bellevue" and once to configure "http://ericle1".
Suppose I want to delete the second mapping. Here's what I'd do:
C:\Install>slkadm -o deletemapping -guid 936ca441-9a5a-4cbb-b772-185d011fba5c SLK mapping deleted for SPSite GUID 936ca441-9a5a-4cbb-b772-185d011fba5c
C:\Install>
I can verify it's deleted as follows:
C:\Install>slkadm -o enummappingshttp://ericle1/districts/bellevue (696119ae-dd2f-42fb-b1c2-f57cef818553) --> Server=ERICLE1;Database=SharePointLearningKit
As you can see, the only mapping left is the first one.
Keep in mind that removing a mapping does not delete the SLK database or any information in that database associated with that site collection. Currently there's no one-step way to delete all information in a SLK database associated with a given site collection. It wouldn't be that hard, though—e.g. a batch file with a bunch of calls to sqlcmd that delete rows from various tables given a SPSite GUID. Perhaps that can be a subject of a future blog posting...
By the way, slkadm.exe does more than just manage SLK mappings. It can also be used to configure SLK and upload a SLK Settings file from the command line or a batch file. But that, too, is another story...