I’ve made numerous changes to most (not all) of the commands. Most of the commands now inherit from SPOperation so they now benefit from the better error handling and command argument processing. As of the time of writing this post the following commands do NOT inherit from SPOperation (still are directly implementing ISPStsadmCommand):
- DisableUserPermissionForWebApp
- EnableUserPermissionForWebApp
- SetSelfServiceSiteCreation
- CreateQuotaTemplate
- EditQuotaTemplate
- ConnectToPortalSite
- SetMasterSiteDirectory
- SetSiteDirectoryScanViewUrls
- EnumTimerJobDefinitions
- GetJobInfo
- GetJobInfos
- RunTimerJob
- SetJobSchedule
- Gen2003To2007ProfilePropertyMap
- Migrate2003ProfilesTo2007
I’ve also changed all the code that was using site.OpenWeb()
to now use site.AllWebs[serverRelativeUrl]
wherever I could. The reason for this was that OpenWeb()
is extremely misleading – if you pass in an url that you think is correct but actually isn’t it will return back the next valid web up in the chain that it can find – this could lead to a whole host of problems so I decided to change the code to use AllWebs which will throw an exception if you attempt to load an invalid url (I think that OpenWeb(url)
will do the same).
Update 10/17/2007: I’ve now updated all of my custom commands to use the SPOperation base class. The only classes that do not inherit from this base class are the original 4 that I did not create: GetJobInfo
, GetJobInfos
, RunTimerJob
, and SetJobSchedule
. Note that out of respect for the original author I will not be updating these remaining four commands despite the benefits that would be gained.