slkadm for SharePoint Learning Kit

26 February, 2009

slkadm for SharePoint Learning Kit

slkadm is a tool which ships with the SharePoint Learning Kit and is analogous to stsadm for SharePoint itself, in that it’s used the administratively configure SLK, in particular the SLK mappings.

What is an SLK mapping?

An SLK mapping is the link between a site collection and the SLK data. For each site collection you want to use SLK with you must create a mapping. You would normally do this through SharePoint Central Administration | Application Management | SharePoint Learning Kit.

A mapping consists of:

  • The GUID of the site collection – this uniquely identifies the site collection
  • The database connection details
  • The names of the SLK permissions
  • The SlkSettings file used to define the queries used in the Assignment List Web Part and elsewhere.

To re-iterate, if a site collection does not have an SLK mapping associated with it, you will not be able to use SLK on that site. A common problem is not setting the correct site collection on the Configure SharePoint Learning Kit page. It’s actually not that obvious which site collection the page is going to update, even though it’s the first control on the page.

What can slkadm do?

slkadm is a command line tool and can perform 4 tasks:

  • Configure a site collection / mapping. Either one which hasn’t been configured before, or update an existing mapping.
  • Show the existing mapping for a site collection.
  • Show all mappings on the server
  • Delete a mapping

Configure a site collection

The command for this is

slkadm.exe -o configuresite -url http://server/site -databaseserver myDbServer -databasename myDatabase -createdatabase -instructorPermission “SLK Instructor” -learnerPermission “SLK Learner” -observerPermission “SLK Observer” -createPermissions -uploadSlkSettings “file name of slksettings.xml” -defaultSettings

The arguments for these are fairly self explanatory Some notes are:

  • createdatabase. If this is present then the database is created
  • createPermissions – Create the permission levels
  • defaultSettings – Use the default slksettings.xml. Cannot be used with uploadSlkSettings

Show the existing mapping for a site collection

The command for this is

slkadm.exe -o getsiteconfiguration -url http://server/site

and an example output is


Notice that slkadm has “found” the SLK configuration and then listed what is configured. The output could be clearer though, here’s one for a site collection which has not been configured:


Although it does state that “no SLK configuration found”, it then goes on to list the default settings, so at first glance it could be configured.

Show all mappings on the server

The command for this is simply

slkadm.exe -o enummappings

with an example output as


You will get one line per site collection configured, with some minimal information – the site url, GUID and database details. In the example here I’ve got 2 site collections configured for slk.

Delete a mapping

The command for this is 

slkadm.exe -o deletemapping -guid 1234abcd-1234-abcd-1234-abcd1234abcd

where the GUID is replaced by the GUID of the site collection. The easiest way to get the GUID is by running the enummappings or getsiteconfiguration commands. 

This will delete the mapping, and disable SLK on the site collection, but it will not remove the database or the Assignment List Web Parts from any pages in the site collection.

List the commands

As is standard with any command line tool you can view the commands by running

slkadm.exe /?


Richard Willis

Written by

Copyright © 2024 SalamanderSoft Limited