Regardless of the moderation state of any item within the specified list, the PublishAllItems command will publish any item that's checked-out, pending approval, or pending publishing.
The command has two required parameters and two optional parameters:
Argument | Description |
-url <url> | Required. The URL of any site within a site collection.* |
-list <list name> | Required. Name of the list containing items to publish. |
-includeSubSites | Optional. If specified, the command will perform the same action on all lists of the same name in all subsites. |
-displayProgress | Optional. If specified, all check-in, approval, and publishing actions are logged to the command window. This makes it easier to see what is going on and the progress of the action. This switch was formerly called "verbose". |
* Regardless of the URL specified, PublishAllItems will execute at the root site within the site collection. The current version does not provide the capability to specify an individual site within a site collection, however it will be included in a future version.
To get help on the command, simply enter STSADM.EXE -help PublishAllItems at a command window.
To run PublishAllItems, you can enter the following command at a command prompt (assuming you have created a new site using the Publishing Portal template provided out-of-the-box in the MOSS 2007 RTW release):
STSADM.EXE -o PublishAllItems -url http://wcm -list Pages
This command will publish all the items within the Pages list in the root web of the Publishing site found in the http://wcm1 site collection. Another example using the two optional parameters is shown below:
Special thanks to Angus Logan who passed along his console app that did a similar thing. I just added some error trapping and made it a custom command for STSADM.EXE, as well as much better memory management.