在 SharePoint 服务器的 Microsoft PowerShell 映射到 Stsadm

 

**上一次修改主题:**2017-08-24

**摘要:**列出 Stsadm 操作和其等效PowerShell cmdlet。

如果这些操作和 cmdlet 之间没有一对一映射,则表中会列出获取相同功能必须使用的特定 PowerShell 参数。

Stsadm 操作

Windows PowerShell cmdlet

Activatefeature

Enable-SPFeature

Activateformtemplate

Enable-SPInfoPathFormTemplate

Addalternatedomain

New-SPAlternateUrl

Addcontentdb

Mount-SPContentDatabase

New-SPContentDatabase

Addexemptuseragent

Add-SPInfoPathUserAgent

Addpath

New-SPManagedPath

Addpermissionpolicy

Addsolution

Add-SPSolution

Addtemplate

Adduser

New-SPUser

Addwppack

Install-SPWebPartPack

Addzoneurl

New-SPAlternateUrl

Allowuserformwebserviceproxy

Set-SPInfoPathWebServiceProxy

使用 AllowForUserFormsIdentity 参数。

Allowwebserviceproxy

Set-SPInfoPathWebServiceProxy

使用 AllowWebServiceProxyIdentity 参数。

Authentication

Set-SPWebApplication

使用 AuthenticationMethodAuthenticationProvider 参数。

Backup

Backup-SPConfigurationDatabase

Backup-SPFarm

Backup-SPSite

Backuphistory

Get-SPBackupHistory

Binddrservice

Blockedfilelist

Canceldeployment

Changepermissionpolicy

Copyappbincontent

Createadminvs

New-SPCentralAdministration

Creategroup

Createsite

New-SPSite

Createsiteinnewdb

New-SPSite 使用 ContentDatabase 参数。

New-SPContentDatabase

Createweb

New-SPWeb

Databaserepair

Deactivatefeature

Disable-SPFeature

Deactivateformtemplate

Disable-SPInfoPathFormTemplate

Deleteadminvs

Deletealternatedomain

Remove-SPAlternateUrl

Deleteconfigdb

Remove-SPConfigurationDatabase

Deletecontentdb

Dismount-SPContentDatabase

Deletegroup

Deletepath

Remove-SPManagedPath

Deletepermissionpolicy

Deletesite

Remove-SPSite

Deletesolution

Remove-SPSolution

Deletetemplate

Deleteuser

Remove-SPUser

Deleteweb

Remove-SPWeb

Deletewppack

Uninstall-SPWebPartPack

Deletezoneurl

Remove-SPAlternateUrl

Deploysolution

Install-SPSolution

Deploywppack

Install-SPWebPartPack

Disablessc

Displaysolution

Get-SPSolution

Editcontentdeploymentpath

Set-SPContentDeploymentPath

Email

Enablessc

Enumalternatedomains

Get-SPAlternateURL

Enumcontentdbs

Get-SPContentDatabase

Enumdataconnectionfiledependants

Get-SPDataConnectionFileDependent

Enumdataconnectionfiles

Get-SPDataConnectionFile

Enumdeployments

Enumexemptuseragents

Get-SPInfoPathUserAgent

Enumformtemplates

Get-SPInfoPathFormTemplate

Enumgroups

Enumroles

Enumservices

Get-SPServiceInstance

Enumsites

Get-SPSiteAdministration(要运行此 cmdlet,您必须是 Farm Administrators 组的成员。)

Get-SPSite(若要运行该 cmdlet,您必须安装SharePoint Server的计算机上的本地管理员。)

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

Getadminport

Get-SPWebApplication

使用以下语法:

Get-SPWebApplication -IncludeCentralAdministration | ? {$_.IsAdministrationWebApplication -eq $true}

Getdataconnectionfileproperty 属性

Get-SPDataConnectionFile

使用以下语法:

Get-SPDataConnectionFile | where {$_.Name -eq "dataConFileName"} | format-list

Getformtemplateproperty 属性

Get-SPInfoPathFormTemplate

使用以下语法:

Get-SPInfoPathFormTemplate | where {$_.DisplayName -eq "formTemplateName"} | format-list

Getosearchsetting

Getproperty

Get-SPFarmConfig

Get-SPTimerJob

Disable-SPTimerJob

Enable-SPTimerJob

Set-SPTimerJob

Start-SPTimerJob

Getsitelock

Get-SPSiteAdministration

Getsiteuseraccountdirectorypath

Geturlzone

Get-SPAlternateURL

Import

Import-SPWeb

Installfeature

Install-SPFeature

Listlogginglevels

Get-SPLogLevel

Listqueryprocessoroptions

Listregisteredsecuritytrimmers

Get-SPEnterpriseSearchSecurityTrimmer

Localupgradestatus

Managepermissionpolicylevel

Mergecontentdbs

Move-SPSite

Migrateuser

Move-SPUser

Osearch

对于 Osearch 参数 farmcontactemailfarmperformancelevelfarmserviceaccountfarmservicepassword,使用 Get-SPEnterpriseSearchServiceSet-SPEnterpriseSearchService cmdlet。

对于 Osearch 参数 startstop,分别使用 Start-SPEnterpriseSearchServiceInstanceStop-SPEnterpriseSearchServiceInstance cmdlet。

对于 Osearch 参数 defaultindexlocation,使用 Get-SPEnterpriseSearchServiceInstance cmdlet。

Osearchdiacriticsensitive

使用 Get-SPEnterpriseSearchServiceApplication cmdlet 来检索特定的 Search Service 应用程序,然后从 Set-SPEnterpriseSearchServiceApplication cmdlet 中使用 DiacriticSensitive 参数。

Profilechangelog

无。

但是,如果用服务应用程序 (SA) 名称替换共享服务提供程序 (SSP) 名称,则可使用 Stsadm profilechangelog 操作。

stsadm -o profilechangelog
-title <SA name>
-daysofhistory <number of days>
-generateanniversaries

有关服务应用程序的详细信息,请参阅关于 SharePoint Server 中的服务应用程序和服务

Provisionservice

Start-SPServiceInstance

Quiescefarm

Quiescefarmstatus

Quiesceformtemplate

Stop-SPInfoPathFormTemplate

Reconvertallformtemplates

Update-SPInfoPathFormTemplate

Refreshdms

Refreshsitedms

Registersecuritytrimmer

New-SPEnterpriseSearchSecurityTrimmer

Registerwsswriter

Removedataconnectionfile

Uninstall-SPDataConnectionFile

Removedrservice

Removeexemptuseragent

Remove-SPInfoPathUserAgent

Removeformtemplate

Uninstall-SPInfoPathFormTemplate

Removesolutiondeploymentlock

Renameserver

Rename-SPServer

Renamesite

Set-SPSite

使用 Url 参数。

Renameweb

Set-SPWeb

使用 RelativeUrl 参数。

Restore

Restore-SPFarm

Restore-SPSite

Retractsolution

Uninstall-SPSolution

Retractwppack

Runcontentdeploymentjob

Start-SPContentDeploymentJob

Scanforfeatures

Install-SPFeature

使用 Scanforfeatures 参数。

Setadminport

Set-SPCentralAdministration

Setapppassword

Setconfigdb

Connect-SPConfigurationDatabase

Setcontentdeploymentjobschedule

Set-SPContentDeploymentJob

Setdataconnectionfileproperty

Set-SPDataConnectionFile

Setformtemplateproperty

Set-SPInfoPathFormTemplate

Setlogginglevel

Set-SPLogLevel

Setosearchsetting

Setproperty

Set-SPFarmConfig

Get-SPTimerJob

Disable-SPTimerJob

Enable-SPTimerJob

Set-SPTimerJob

Start-SPTimerJob

Setqueryprocessoroptions

Setsitelock

Set-SPSiteAdministration

使用 LockState 参数。

Setsiteuseraccountdirectorypath

Get-SPSiteSubscription

New-SPSiteSubscription

Remove-SPSiteSubscription

Setworkflowconfig

Set-SPWorkflowConfig

Siteowner

Set-SPSiteAdministration

Syncsolution

Install-SPSolution

使用 Synchronize 参数。

Unextendvs

Remove-SPWebApplication

Uninstallfeature

Uninstall-SPFeature

Unquiescefarm

Unquiesceformtemplate

Start-SPInfoPathFormTemplate

Unregistersecuritytrimmer

Remove-SPEnterpriseSearchSecurityTrimmer

Unregisterwsswriter

Updateaccountpassword

Set-SPManagedAccount

Updatealerttemplates

Updatefarmcredentials

Upgrade

Upgradeformtemplate

Install-SPInfoPathFormTemplate

Upgradesolution

Update-SPSolution

Upgradetargetwebapplication

Uploadformtemplate

Install-SPInfoPathFormTemplate

Userrole

Get-SPUser

Move-SPUser

New-SPUser

Remove-SPUser

Set-SPUser

Verifyformtemplate

Test-SPInfoPathFormTemplate

See also

索引的 Microsoft PowerShell cmdlet 的 SharePoint 服务器