|
|||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionWith Microsoft Office SharePoint Server 2007 (MOSS) and of course the WSS v3, it is possible to implement custom commands for the STSADM Administration Tool. Why?You want to implement little helpers for developing/testing without an administration interface. You want to add functionality for administrators to help them, including the possibility to script those commands for batch usage. There might be some other reasons to implement custom commands, but the ones above are the most asked questions and purposes. My intention in this is mainly supposed to help developers who implement custom timer jobs like I did. How?Developing a custom command is very simple. There is only a small overhead of managing the project and deploying it. That's good, so you can focus on the main goal. You need one class which implements ISPStsadmCommand and an XML file for the registration of your command so that the stsadm.exe knows what to do with your command. Depending on the parameters and functionality you provide, you write some help messages for the user to display on the command prompt. If you are an aesthetic, this might take longer than normal. I give you a short sample on how to implement a custom command. Detailed instructions can be found in an article by Tony Bierman.
In my current project, I have developed some timer jobs for SharePoint and found it very unhandy to administrate the jobs. So I started to implement a set of commands which I want to share with you. If new commands get developed, I update this collection. CommandsGetJobInfoDisplays information about a specific timer job.
Help of the
GetJobInfo command.
Output of the
GetJobInfo command. I found it useful to get the range of the next occurrence. Moreover, I used this command to verify changes I made to the job definition. GetJobInfosSimilar to the
Help of the
GetJobInfos command. With this information, you can get the name of the timer job needed for the RunTimerJobExecutes the specified Timer Job immediately.
Help of the
RunTimerJob command. To test the functionality of a job when YOU need it, you can now simply execute a timer job. With that, you can execute a job on a test/live server although it's configured for a daily schedule. That's what I did in my current project. On my development machine, I have set a minute schedule and on the live server, there needs to be a daily schedule. As I know, the only place where you set the time a job executes is a feature with the SetJobScheduleSets the schedule of a specified job.
Help of the
SetJobSchedule command. With this command you can change the time a job executes. Very handy for development to live changes and vice versa. Look at what I mentioned in the command before. HINT: It's not possible to change a Recommendations/OptimizationsUse resource files to translate error/hint messages if applicable. Although it's possible, do not implement more than one command functionality in one class. You get the command passed in the What I don't know at this time is the handling of the I will update this "command set" when I develop new commands (and I can publish that). If you like this information and perhaps find the commands useful, or even better if you can use them, please let me know.
|
||||||||||||||||||||||||||||||||||||||||||||