This project has moved. For the latest updates, please go here.

Extending stsadm with SLK specific group creation command

Topics: User Forum
Oct 15, 2006 at 9:13 PM
After some trial and error I am able to create sites, groups, users and add SLK Learner roles to a user using:-

stsadm.exe -o createweb -url http://sps02:35253/science -sitetemplate STS#0 -title Science -unique
stsadm.exe -o creategroup -url http://sps02:35253/science -name Y11Sc1 -description Y11Sc1 -ownerlogin bcs\administrator -type visitor (***** problem*****)
stsadm.exe -o adduser -url http://sps02:35253/science -userlogin dom\USER1 -useremail -role "Read" -group Y11Sc1 -username "B93453"
stsadm.exe -o userrole -url http://sps02:35253/science -userlogin dom\user1 -role "SLK Learner" -add

The problem, however, lies in the group permission level assigned. With the above configuration, when I to assign a document to a student in the site, the student appears but the group does not. I assume that the SLK only selects groups which have the SLK Learner role assigned to them. If this is the case then there needs to be some facility to assign groups the SLK Learner or SLK Instructor roles other than navigating to each group and checking the SLK Learner or SLK instructor role as this would take a considerable amount of time given that there are in excess of 800 classes each year.

My questions then are:-

Does SLK only select groups with the SLK learner role assigned?

Is it possible to extend stsadm with a custom command that will extend the creategroup command switch -type to include the SLK Learner and SLK Instructor? Or perhaps a specialised version of the command eg SLKcreategroup that automatically adds these roles or one of the roles to the new group

I have been looking at the Sharepoint solutions blog and believe this is possible.

If this could be achieved it would be a real step forwards for us.
Oct 15, 2006 at 10:05 PM
Hold the phone!!

Turns out the userrole command which has a switch -userlogin <domain\name> which you would think would be used to add roles to domain users, can be used to add roles to Sharepoint groups! eg

stsadm.exe -o userrole -url http://sps02:35253/science -userlogin Y11Sc6 -role "SLK Learner" -add

(note Y11Sc6 is a Sharepoint group)

Not the most obvious of switches perhaps the help should read -userlogin <domain\name> or <sharepoint group> or the switch should be renamed -userorgroup
or the operation renamed assignrole?!

I have leanrt a lot of lessons over the past few days, three of which are always try it yourself, never trust the help file and keep your powder dry.

I hope to God the stsadm.exe is not changed from now until release to disable this ability. Should I even have written this?
Oct 16, 2006 at 8:41 PM
Nice work!