Ever need to modify all of the sites in a SharePoint web application? I never had to do this until we decided to roll out the powerful Telerik radEditor to all of our sites. In the past, radEditor was scoped “globally”, meaning that once installed to the Web App, all sites started using it. However, the current release is scoped “per site”. To activate on all sites, we have to do a few things (well, a lot of things, really):
Here is the blow-by-blow:
- Retract radEditor Lite (global scope version)
- stsadm -o retractsolution -name radeditormoss.wsp
- You will find one ONET.XML per site-template. This file is located in the <Template>Xml subdirectory of “C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATESiteTemplates”
- In the <WebFeatures> section of each ONET.xml, add the following:
<!– radEditor MOSS Feature –>
<Feature ID=”747755CD-D060-4663-961C-9B0CC43724E9″ />
<!– radEditor MOSS IE Feature –>
<Feature ID=”F374A3CA-F4A7-11DB-827C-8DD056D89593″ />
- See my previous post on Taking control of SharePoint
- From “CMD”, run:
stsadm -o enumsites -url [SharePointWebAppURL] > [enumsitesXMLfile] - The UNIX utility “CUT” will be used to trim out all XML code from the output file. Sadly, there appears to be a bug in “CUT when executed from within CMD that prevents further standard output redirection or pipelining, so we now switch to a UNIX shell (cygwin “bash”, or the UnxUtils SH.exe):
cat [enumsitesXMLfile] | cut -f2 -d” -s > [enumsitesTXTfile]
unix2dos [enumsitesTXTfile]
(We are “cutting” after the first text delimiter (or “field 2”) using the quotation mark as the delimiter. Note that the quote character (“) needs to be escaped (). Use of UNIX2DOS will convert the UNIX-style output file to Windows semantics.)
- FOR /f %s IN ([enumsitesTXTfile]) DO stsadm -o enumsubwebs -url “%s” | find “<Subweb>” > [subwebXMLfile]
- In BASH:
cat [subwebXMLfile] | cut -c11- | cut -f1 -d< > [subwebTXTfile]
unix2dos [subwebTXTfile]
(Here we use “cut” to trim after the 11th character in the source file, and then agan after the first “” character.) - Consolidate sites and subwebs into single control file
- type [subwebTXTfile] > [masterTXTSiteList]
- type [enumsitesTXTfile] >> [masterTXTSiteList]
- Using GnuWin32 “sort” command:
sort -du [masterTXTSiteList] > [masterSortedTXTSiteList]
- FOR /F %s IN ([masterSortedTXTSiteList]) DO stsadm -o activatefeature -name radEditorFeature -url “%s” & stsadm -o activatefeature -name radEditorFeatureIE -url “%s”