I created this only because I needed to debug some issues I've been having with Page Layouts - try to convert a sub-site to a site collection and you'll see what I mean :). I doubt this command will be very useful to anyone but seeing as I've got it coded and working there was no sense in pulling the code. The command itself, gl-enumavailablepagelayouts, is very simple - it just outputs the available page layouts by calling GetAvailablePageLayouts() from a PublishingWeb object.
I'm outputting this code in XML as I wanted to display more things than what made sense in a flat file list (I suppose someone could use the output of this command for something else). The core code is shown below:
The syntax of the command can be seen below:
C:\>stsadm -help gl-enumavailablepagelayouts stsadm -o gl-enumavailablepagelayouts Returns the list of page layouts available for the given site collection. Parameters: -url <site collection url>
Here’s an example of how to return the avilable page layouts for a publishing site site collection:
stsadm –o gl-enumavailablepagelayouts –url "http://intranet/"
The results of running the above command can be seen below: