I’ve been wanting to release the SharePoint 2010 version of my STSADM extensions for quite some time but honestly just haven’t had the time to migrate as many as I would have liked. With over 145 STSADM extensions for SharePoint 2007 it was a challenge determining which ones I should focus on initially for the migration.

But today I’m happy to announce my initial release which contains 46 PowerShell cmdlets and 56 STSADM commands specific to SharePoint 2010. Yup, you read right, I’ve decided to maintain support for my STSADM commands and have been migrating them over as I create the equivalent replacement PowerShell cmdlet (though I recommend you don’t use them and suck it up and get used to PowerShell). You should note that there are more STSADM commands than PowerShell cmdlets – that’s because some of the things I was doing with STSADM can now easily be done with out of the box PowerShell cmdlets (I also have new PowerShell cmdlets that do not have an STSADM equivalent – everything new I create will be a cmdlet and I’ll create no new STSADM commands).

It’s going to take me a while to create all the posts needed to explain each cmdlet (assuming I create one at all) so for now I’ve created this simple table which lists all the STSADM commands and PowerShell cmdlets that are available in this initial release (I’ll eventually update my command index page but for now let this serve as the main reference for what is available as of 5/14/2010):

STSADM CommandsPowerShell CmdletsNotes
gl-activatefeatureEnable-SPFeature2There’s an OOTB Enable-SPFeature cmdlet, this one simple adds some capabilities which were present in my existing STSADM command.
gl-addaudienceruleNew-SPAudienceRule
gl-addavailablesitetemplateI’ll eventually create a cmdlet for this.
gl-adduser2Use the OOTB New-SPUser cmdlet.
gl-adduserpolicyforwebappAdd-SPWebApplicationUserPolicy
gl-applythemeThis can be done pretty easily using Get-SPWeb and the ApplyTheme() method of the SPWeb object.
gl-backupUse the OOTB Backup-SPFarm and Backup-SPSite cmdlets.
gl-backupsitesBackup-SPSite2Extends Backup-SPSite by including IIS settings.
gl-convertsubsitetositecollectionConvertTo-SPSite
gl-copycontenttypesCopy-SPContentType
gl-copylistCopy-SPList
gl-copylistsecurityCopy-SPListSecurity
gl-createaudienceNew-SPAudience
gl-createcontentdbUse the OOTB New-SPContentDatabase cmdlet.
gl-createpublishingpageNew-SPPublishingPage
gl-createquotatemplateNew-SPQuotaTemplate
gl-createwebappUse the OOTB New-SPWebApplication cmdlet
gl-deactivatefeatureDisable-SPFeature2Extends the OOTB Disable-SPFeature cmdlet.
gl-deleteallusersI probably won’t replicate this as it is easily done using the OOTB Remove-SPUser cmdlet.
gl-deleteaudienceRemove-SPAudience
gl-deletelistRemove-SPList
gl-deletewebappUse the OOTB Remove-SPWebApplication cmdlet.
gl-disableuserpermissionforwebappThis is fairly easy to do OOTB so I may not create a cmdlet for it.
gl-editquotatemplateSet-SPQuotaTemplate
gl-enableuserpermissionforwebappThis is fairly easy to do OOTB so I may not create a cmdlet for it.
gl-enumaudiencerulesExport-SPAudienceRules
gl-enumavailablepagelayoutsGet-SPPublishingPageLayout
gl-enumavailablesitetemplatesGet-SPAvailableWebTemplates
gl-enumeffectivebasepermsThis is fairly easy to do OOTB so I may not create a cmdlet for it.
gl-enumfeaturesUse the OOTB Get-SPFeature cmdlet.
gl-enuminstalledsitetemplatesUse the OOTB Get-SPWebTemplate cmdlet.
gl-enumpagewebpartsGet-SPWebPartList
gl-enumunghostedfilesGet-SPCustomizedPages
gl-execadmsvcjobsStart-SPAdminJob2I honestly need to research this a bit more as I’m not sure it’s necessary anymore but I’ve replicated the functionality in case someone finds it useful.
gl-exportaudiencesExport-SPAudiences
gl-exportcontenttypesExport-SPContentType
gl-exportlistExport-SPWeb2I’ve just extended the Export-SPWeb2 cmdlet to add additional parameters.
gl-exportlistsecurityExport-SPListSecurity
gl-extendwebappUse the OOTB New-SPWebApplicationExtension cmdlet.
gl-fixpublishingpagespagelayouturlRepair-SPPageLayoutUrl
gl-importaudiencesImport-SPAudiences
gl-importlistImport-SPWeb2I’ve just extended the Import-SPWeb2 cmdlet to add additional parameters.
gl-importlistsecurityImport-SPListSecurity
gl-listaudiencetargetingSet-SPListAudienceTargeting
gl-managecontentdbsettingsUse the OOTB Set-SPContentDatabase cmdlet.
gl-propagatecontenttypePropagate-SPContentType
gl-publishitemsPublish-SPListItems
gl-reghostfileReset-SPCustomizedPages
gl-removeavailablesitetemplateI’ll eventually create a cmdlet for this (maybe).
gl-repairsitecollectionimportedfromsubsiteRepair-SPSite
gl-replacewebpartcontentReplace-SPWebPartContent
gl-setbackconnectionhostnamesSet-SPBackConnectionHostNames
gl-setselfservicesitecreationNot sure if I’ll migrate this or not.
gl-syncquotasSet-SPQuota
gl-tracelogUse the OOTB Set-SPDiagnosticConfig cmdlet.
gl-unextendwebappUse the OOTB Remove-SPWebApplication cmdlet.
Get-SPAudience
Get-SPAudienceManager
Get-SPContentType
Get-SPFile
Get-SPLimitedWebPartManager
Get-SPList
Get-SPPublishingPage
Get-SPQuotaTemplate
Set-SPAudience

For those that know a thing or two about cmdlet development you might be

interested in knowing that I am dynamically generating the help XML file for the cmdlets. If you download the source you’ll find a class which uses reflection to interrogate the assembly and dynamically build the help file just prior to building the WSP package. This saved me literally days of hand editing XML.

You can download the source and WSP files here or from the Downloads page:

After you deploy the package you can type help <cmdlet name> to get detailed help about each cmdlet, including parameter descriptions and example usage. If you want to see the list of cmdlets installed type the following:

1gcm | where {$_.DLL like "*lapointe*"}

As always, your use of these cmdlets/stsadm commands is at your own risk – I do as much testing as I can but every environment is different and there’s simply not enough time in a day. If you have any suggestions or feedback please don’t hesitate to leave a comment – I appreciate all of them!