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

适用于:yes-img-132013 yes-img-162016 yes-img-192019 yes-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

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

   
Stsadm 操作 Windows PowerShell cmdlet
Activatefeature Enable-SPFeature
Activateformtemplate Enable-SPInfoPathFormTemplate
Addalternatedomain New-SPAlternateUrl
Addcontentdb Mount-SPContentDatabaseNew-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 参数。
身份验证 Set-SPWebApplication 使用 AuthenticationMethodAuthenticationProvider 参数。
备份 Backup-SPConfigurationDatabaseBackup-SPFarmBackup-SPSite
Backuphistory Get-SPBackupHistory
Binddrservice
Blockedfilelist
Canceldeployment
Changepermissionpolicy
Copyappbincontent Install-SPApplicationContent
Createadminvs New-SPCentralAdministration
Creategroup
Createsite New-SPSite
Createsiteinnewdb New-SPSite 使用 ContentDatabase 参数。 New-SPContentDatabase
Createweb New-SPWeb
Databaserepair 使用 Get-SPContentDatabaseOrphanedData 检测孤立数据,但请注意,它不会修复孤立的数据。
Deactivatefeature Disable-SPFeature
Deactivateformtemplate Disable-SPInfoPathFormTemplate
Deleteadminvs Remove-SPCentralAdministration
Deletealternatedomain Remove-SPAlternateUrl
Deleteconfigdb Disconnect-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
"电子邮件" Set-SPWebApplication 与 -SMTPServer 参数集结合使用。
Enablessc
Enumallwebs Get-SPContentDatabaseOrphanedData
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,您必须是场管理员组的成员。) 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-SPFarmConfigGet-SPTimerJobDisable-SPTimerJobEnable-SPTimerJobSet-SPTimerJobStart-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 无。 但是,如果将共享服务提供程序 (SSP) 名称替换为服务应用程序 (SA) 名称,则可以使用 Stsadm profilechangelog 操作: stsadm -o profilechangelog-title <SA name>-daysofhistory <number of days>-generateanniversaries
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-SPFarmRestore-SPSite
Retractsolution Uninstall-SPSolution
Retractwppack
Runcontentdeploymentjob Start-SPContentDeploymentJob
Scanforfeatures Install-SPFeature 使用 Scanforfeatures 参数。
Setadminport Set-SPCentralAdministration
Setapppassword Set-SPApplicationCredentialKeyRemove-SPApplicationCredentialKey
Setconfigdb Connect-SPConfigurationDatabase
Setcontentdeploymentjobschedule Set-SPContentDeploymentJob
Setdataconnectionfileproperty Set-SPDataConnectionFile
Setformtemplateproperty Set-SPInfoPathFormTemplate
Setlogginglevel Set-SPLogLevel
Setosearchsetting
Setproperty Set-SPFarmConfigGet-SPTimerJobDisable-SPTimerJobEnable-SPTimerJobSet-SPTimerJobStart-SPTimerJob
Setqueryprocessoroptions
Setsitelock Set-SPSiteAdministration 使用 LockState 参数。
Setsiteuseraccountdirectorypath Get-SPSiteSubscriptionNew-SPSiteSubscriptionRemove-SPSiteSubscription
Setworkflowconfig Set-SPWorkflowConfig
Siteowner Set-SPSiteAdministration
同步 Update-SPProfileSyncClear-SPContentDatabaseSyncGet-SPContentDatabase (与 -DaysSinceLastProfileSync 参数)
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-SPUserMove-SPUserNew-SPUserRemove-SPUserSet-SPUser
Verifyformtemplate Test-SPInfoPathFormTemplate

另请参阅

其他资源

Index of Microsoft PowerShell cmdlets for SharePoint Server