Stsadm to Windows PowerShell mapping

For the ones who are well versed with stsadm and switching to PowerShell, the following table provides a mapping of stsadm commands to their PowerShell counterparts

Stsadm operation Windows PowerShell cmdlet
Activatefeature Enable-SPFeature
Addalternatedomain New-SPAlternateUrl
Addcontentdb Mount-SPContentDatabase New-SPContentDatabase
Addpath New-SPManagedPath
Addpermissionpolicy None
Addsolution Add-SPSolution
Addtemplate Install-SPWebTemplate
Adduser New-SPUser
Addwppack Install-SPWebPartPack
Addzoneurl New-SPAlternateUrl
Authentication Set-SPWebApplication Use the AuthenticationMethod or AuthenticationProvider parameters.
Backup Backup-SPConfigurationDatabase Backup-SPFarm Backup-SPSite
Backuphistory Get-SPBackupHistory
Binddrservice None
Blockedfilelist None
Canceldeployment None
Changepermissionpolicy None
Copyappbincontent None
Createadminvs New-SPCentralAdministration
Creategroup None
Createsite New-SPSite
Createsiteinnewdb New-SPSite Use the ContentDatabase parameter. New-SPContentDatabase
Createweb New-SPWeb
Databaserepair None
Deactivatefeature Disable-SPFeature
Deleteadminvs None
Deletealternatedomain Remove-SPAlternateUrl
Deleteconfigdb Remove-SPConfigurationDatabase
Deletecontentdb Dismount-SPContentDatabase
Deletegroup None
Deletepath Remove-SPManagedPath
Deletepermissionpolicy None
Deletesite Remove-SPSite
Deletesolution Remove-SPSolution
Deletetemplate Uninstall-SPWebTemplate
Deleteuser Remove-SPUser
Deleteweb Remove-SPWeb
Deletewppack Uninstall-SPWebPartPack
Deletezoneurl Remove-SPAlternateUrl
Deploysolution Install-SPSolution
Deploywppack Install-SPWebPartPack
Disablessc None
Displaysolution Get-SPSolution
Email None
Enablessc None
Enumalternatedomains Get-SPAlternateURL
Enumcontentdbs Get-SPContentDatabase
Enumdeployments None
Enumgroups None
Enumroles None
Enumservices Get-SPServiceInstance
Enumsites Get-SPSiteAdministration (To run this cmdlet, you must be a member of the Farm Administrators group.) Get-SPSite (To run this cmdlet, you must be a local administrator on the computer where SharePoint 2010 Products is installed.)
Enumsolutions Get-SPSolution
Enumsubwebs Get-SPWeb
Enumtemplates Get-SPWebTemplate
Enumusers Get-SPUser
Enumwppacks Get-SPWebPartPack
Enumzoneurls Get-SPAlternateURL
Execadmsvcjobs Start-SPAdminJob
Export Export-SPWeb
Extendvs New-SPWebApplication
Extendvsinwebfarm New-SPWebApplicationExtension
Forcedeletelist None
Getadminport Get-SPWebApplication Use the following syntax:
  • Get-SPWebApplication -IncludeCentralAdministration | ? {$_.IsAdministrationWebApplication -eq $true} 
Getproperty Get-SPFarmConfig Get-SPTimerJob Disable-SPTimerJob Enable-SPTimerJob Set-SPTimerJob Start-SPTimerJob
Getsitelock Get-SPSiteAdministration
Geturlzone Get-SPAlternateURL
Import Import-SPWeb
Installfeature Install-SPFeature
Listlogginglevels Get-SPLogLevel
Localupgradestatus None
Managepermissionpolicylevel None
Mergecontentdbs Move-SPSite
Migrateuser Move-SPUser
Provisionservice Start-SPServiceInstance
Refreshdms None
Refreshsitedms None
Registerwsswriter None
Removedrservice None
Removesolutiondeploymentlock None
Renameserver Rename-SPServer
Renamesite Set-SPSite Use the Url parameter.
Renameweb Set-SPWeb Use the RelativeUrl parameter.
Restore Restore-SPFarm Restore-SPSite
Retractsolution Uninstall-SPSolution
Retractwppack None
Scanforfeatures Install-SPFeature Use the Scanforfeatures parameter.
Setadminport Set-SPCentralAdministration
Setapppassword None
Setconfigdb Connect-SPConfigurationDatabase
Setlogginglevel Set-SPLogLevel
Setproperty Set-SPFarmConfig Get-SPTimerJob Disable-SPTimerJob Enable-SPTimerJob Set-SPTimerJob Start-SPTimerJob
Setsitelock Set-SPSiteAdministration Use the LockState parameter.
Setworkflowconfig Set-SPWorkflowConfig
Siteowner Set-SPSiteAdministration
Spsearch Get-SPSearchService Set-SPSearchService Get-SPSearchServiceInstance Set-SPSearchServiceInstance
Spsearchdiacriticsensitive None
Syncsolution Install-SPSolution Use the Synchronize parameter.
Unextendvs Remove-SPWebApplication
Uninstallfeature Uninstall-SPFeature
Unregisterwsswriter None
Updateaccountpassword Set-SPManagedAccount
Updatealerttemplates None
Updatefarmcredentials None
Upgrade None
Upgradesolution Update-SPSolution
Upgradetargetwebapplication None
Userrole Get-SPUser Move-SPUser New-SPUser Remove-SPUser Set-SPUser

Hiding SharePoint Lists

Sometimes we do feel a need to hide SharePoint Lists. Following are few ways which could some in handy while trying to achieve this objective.
Using SharePoint Designer:

  1. Start SharePoint Designer and open your site.
  2. Click on the “Lists and Libraries” in the Navigation pane
  3. Select the list/library which you need to hide
  4. On the details page check the “Hide from browser” checkbox and save
  5. To unhide the list un-check the checkbox and save 
sharepoint designer
SharePoint Designer

Using Code:
The other way is to obviously do this through code. SPList has a property as Hidden which can be set to true or false

using (SPSite site = new SPSite("http://YourSiteUrl"))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.Lists["Announcements"];
                        //Set this property to true or false accordingly
                        list.Hidden = false;
                        list.Update();
                    }
                }