When developing a new site (or adding a new section to an existing site) with Office SharePoint Server (MOSS) 2007 Web Content Management (WCM), you will likely find yourself having to go back through and check-in, approve, and publish numerous items throughout the site. This is a tedious process. It sure would be nice if you could just flip a switch and say “check-in, approve, and publish everything”… wouldn’t it?
I wanted something like this while working on a Publishing site so I created a custom command for STSADM.EXE that will allow you to publish all the items within a site collection. This is just the first of many custom commands I’ll create for WCM developers so I decided to package them all up (today, all one of them) into one project: AC’s WCM Custom Commands for STSADM.EXE.
After installing my custom commands for STSADM.EXE, you can now publish all items in the Pages list within the default site created by the Publishing Portal template by entering the following at a command line:
STSADM.EXE -o PublishAllItems -url http://wcm1 -list Pages
Optionally you can include the argument -IncludeSubSites to have it traverse through all sub sites in the site collection to publish all items in the Pages list in each site.
In a the day-to-day management of a production implementation this is not usually an issue because you want to enforce the publishing workflows.
Before you ask, I plan to add the additional functionality:
Ability to specify a specific site within a site collection (currently it defaults to the root web within the site collection specified).
Ability to specify a wildcard for the list name to publish all items in all lists that have moderation enabled.
Thanks to Angus Logan for providing a console app that implemented most of this functionality already.