Gerenciando WSPs com PowerShell no SharePoint 2010
Olá!
Overview:
Como muitos sabem, a ferramenta STSADM (muito utilizada no MOSS 2007 para gerenciar WSPs e todas outras muitas funcionalidades do SharePoint) no SharePoint 2010 é mantida apenas para fins de compatibilidade, tornando-se obsoleta.
Informações sobre o que eu disse acima e muitas outras coisas que mudaram, em: http://technet.microsoft.com/en-us/library/ff607713.aspx – Changes from Windows SharePoint Services 3.0 to SharePoint Foundation 2010.
Trecho do artigo do TechNet sobre o STSADM:
Deprecated features
The following feature is shipped with SharePoint Foundation 2010 but will be removed from subsequent versions.
Stsadm command-line tool
Description: The Stsadm command-line tool has been deprecated.
Reason for change: The Stsadm command-line tool will be superseded by Windows PowerShell 2.0.
Migration path: The Stsadm command-line tool is included to support compatibility with previous product versions. You should use Windows PowerShell 2.0 when performing command-line administrative tasks.
Então, vamos nos atualizar para os comandos mais utilizados. Neste post, vou falar sobre as tarefas de manutenção de Solutions (WSP’s).
SOLUÇÃO:
Este post certamente encadeará outros sobre o mesmo assunto e, na medida do possível, irei “linkar” eles.
Vamos ao que interessa:
Tip: Usem o SharePoint 2010 Management Shell, fica mais fácil do que ficar adicionando Snap-in toda hora.
STSADM |
PowerShell |
Adicionando uma solution |
Adicionando uma solution |
stsadm –o addsolution –filename “C:\ SolutionPackage.wsp” |
Add-SPSolution –LiteralPath “C:\SolutionPackage.wsp” |
Implantando uma solution (deploy) |
Implantando uma solution (deploy) |
stsadm –o deploysolution –name SolutionPackage.wsp –url http://webapplication –allowgacdeployment –immediate |
Install-SPSolution –Identity SolutionPackage.wsp –WebApplication http://webapplication –GACDeployment |
Atualizando uma solution existente (upgrade) |
Atualizando uma solution existente (upgrade) |
stsadm –o upgradesolution –name SolutionPackage.wsp –filename “C:\SolutionPackage.wsp” –immediate |
Update-SPSolution –Identity Solution.wsp –LiteralPath “C:\SolutionPackage.wsp” –GacDeployment |
Retract da solution |
Retract da solution |
stsadm –o retractsolution –name SolutionPackage.wsp –url http://webapplication –immediate |
Uninstall-SPSolution –Identity SolutionPackage.wsp –WebApplication http://webapplication |
Apagando uma solution |
Apagando uma solution |
stsadm –o deletesolution –name SolutionPackage.wsp |
Remove-SPSolution –Identity SolutionPackage.wsp |
Uma lista completa com um de-para de comandos aqui: http://technet.microsoft.com/en-us/library/ff621084.aspx – Stsadm to Windows PowerShell mapping (SharePoint Server 2010).
Stsadm operation |
Windows PowerShell cmdlet |
Activatefeature |
|
Activateformtemplate |
|
Addalternatedomain |
|
Addcontentdb |
|
Adddataconnectionfile |
|
Add-ecsfiletrustedlocation |
|
Add-ecssafedataprovider |
|
Add-ecstrusteddataconnectionlibrary |
|
Add-ecsuserdefinedfunction |
|
Addexemptuseragent |
|
Addpath |
|
Addpermissionpolicy |
None |
Addsolution |
|
Addtemplate |
|
Adduser |
|
Addwppack |
|
Addzoneurl |
|
Allowuserformwebserviceproxy |
Use the AllowForUserForms and Identity parameters. |
Allowwebserviceproxy |
Use the AllowWebServiceProxy and Identity parameters. |
Authentication |
Use the AuthenticationMethod or AuthenticationProvider parameters. |
Backup |
|
Backuphistory |
|
Binddrservice |
None |
Blockedfilelist |
None |
Canceldeployment |
None |
Changepermissionpolicy |
None |
Copyappbincontent |
None |
Createadminvs |
|
Creategroup |
None |
Createsite |
|
Createsiteinnewdb |
New-SPSite Use the ContentDatabase parameter. |
Createweb |
|
Databaserepair |
None |
Deactivatefeature |
|
Deactivateformtemplate |
|
Deleteadminvs |
None |
Deletealternatedomain |
|
Deleteconfigdb |
|
Deletecontentdb |
|
Deletegroup |
None |
Deletepath |
|
Deletepermissionpolicy |
None |
Deletesite |
|
Deletesolution |
|
Deletetemplate |
|
Deleteuser |
|
Deleteweb |
|
Deletewppack |
|
Deletezoneurl |
|
Deploysolution |
|
Deploywppack |
|
Disablessc |
None |
Displaysolution |
|
Editcontentdeploymentpath |
|
|
None |
Enablessc |
None |
Enumalternatedomains |
|
Enumcontentdbs |
|
Enumdataconnectionfiledependants |
|
Enumdataconnectionfiles |
|
Enumdeployments |
None |
Enumexemptuseragents |
|
Enumformtemplates |
|
Enumgroups |
None |
Enumroles |
None |
Enumservices |
|
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 |
|
Enumsubwebs |
|
Enumtemplates |
|
Enumusers |
|
Enumwppacks |
|
Enumzoneurls |
|
Execadmsvcjobs |
|
Export |
|
Extendvs |
|
Extendvsinwebfarm |
|
Forcedeletelist |
None |
Getadminport |
Use the following syntax: · Get-SPWebApplication -IncludeCentralAdministration | ? {$_.IsAdministrationWebApplication -eq $true} |
Getdataconnectionfileproperty property |
Use the following syntax: · Get-SPDataConnectionFile | where {$_.Name -eq “dataConFileName”} | format-list |
Getformtemplateproperty property |
Use the following syntax: · Get-SPInfoPathFormTemplate | where {$_.DisplayName -eq “formTemplateName”} | format-list |
Getosearchsetting |
None |
Getproperty |
|
Getsitelock |
|
Getsiteuseraccountdirectorypath |
None |
Geturlzone |
|
Import |
|
Installfeature |
|
Listlogginglevels |
|
Listqueryprocessoroptions |
None |
Listregisteredsecuritytrimmers |
|
Localupgradestatus |
None |
Managepermissionpolicylevel |
None |
Mergecontentdbs |
|
Migrateuser |
|
Osearch |
For the Osearch parameters farmcontactemail, farmperformancelevel, farmserviceaccount, and farmservicepassword, use the Get-SPEnterpriseSearchService and Set-SPEnterpriseSearchService cmdlets. For the Osearch parameters start and stop, use the Start-SPEnterpriseSearchServiceInstance and Stop-SPEnterpriseSearchServiceInstance cmdlets, respectively. For the Osearch parameter defaultindexlocation, use the Get-SPEnterpriseSearchServiceInstance and Set-SPEnterpriseSearchServiceInstance cmdlets. |
Osearchdiacriticsensitive |
Use the Get-SPEnterpriseSearchServiceApplication cmdlet to retrieve the specific Search service application, and then use DiacriticSensitive parameter from the Set-SPEnterpriseSearchServiceApplication cmdlet. |
Provisionservice |
|
Quiescefarm |
None |
Quiescefarmstatus |
None |
Quiesceformtemplate |
|
Reconvertallformtemplates |
|
Refreshdms |
None |
Refreshsitedms |
None |
Registersecuritytrimmer |
|
Registerwsswriter |
None |
Removedataconnectionfile |
|
Remove-ecsfiletrustedlocation |
|
Remove-ecssafedataprovider |
|
Remove-ecstrusteddataconnectionlibrary |
|
Remove-ecsuserdefinedfunction |
|
Removedrservice |
None |
Removeexemptuseragent |
|
Removeformtemplate |
|
Removesolutiondeploymentlock |
None |
Renameserver |
|
Renamesite |
Use the Url parameter. |
Renameweb |
Use the RelativeUrl parameter. |
Restore |
|
Retractsolution |
|
Retractwppack |
None |
Runcontentdeploymentjob |
|
Scanforfeatures |
Use the Scanforfeatures parameter. |
Setadminport |
|
Setapppassword |
None |
Setconfigdb |
|
Setcontentdeploymentjobschedule |
|
Setdataconnectionfileproperty |
|
Set-ecsexternaldata |
|
Set-ecsloadbalancing |
Use the LoadBalancingScheme parameter. |
Set-ecsmemoryutilization |
Use the MemoryCacheThreshold and PrivateBytesMax parameters. |
Set-ecssecurity |
Use the CrossDomainAccessAllowed, EncryptedUserConnectionRequired, and FileAccessMethod parameters. |
Set-ecssessionmanagement |
Use the SessionsPerUserMax and SiteCollectionAnonymousSessionsMax parameters. |
Set-ecsworkbookcache |
Use the Workbookcache and WorkbookCacheSizeMax parameters. |
Setformtemplateproperty |
|
Setlogginglevel |
|
Setosearchsetting |
None |
Setproperty |
|
Setqueryprocessoroptions |
None |
Setsitelock |
Use the LockState parameter. |
Setsiteuseraccountdirectorypath |
|
Setworkflowconfig |
|
Siteowner |
|
Syncsolution |
Use the Synchronize parameter. |
Unextendvs |
|
Uninstallfeature |
|
Unquiescefarm |
None |
Unquiesceformtemplate |
|
Unregistersecuritytrimmer |
|
Unregisterwsswriter |
None |
Updateaccountpassword |
|
Updatealerttemplates |
None |
Updatefarmcredentials |
None |
Upgrade |
None |
Upgradeformtemplate |
|
Upgradesolution |
|
Upgradetargetwebapplication |
None |
Uploadformtemplate |
|
Userrole |
|
Verifyformtemplate |
Abraço!