适用于:
2013
2016
2019
订阅版本
Microsoft 365 中的 SharePoint
如果 Stsadm作和 PowerShell 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 使用 AllowForUserForms 和 Identity 参数。 |
| Allowwebserviceproxy | Set-SPInfoPathWebServiceProxy 使用 AllowWebServiceProxy 和 Identity 参数。 |
| 身份验证 | Set-SPWebApplication 使用 AuthenticationMethod 或 AuthenticationProvider 参数。 |
| 备份 | 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 | None |
| 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 | 使用 Get-SPSite 获取站点对象,然后输出 UserAccountDirectoryPath 属性。 |
| Geturlzone | Get-SPAlternateURL |
| Import | Import-SPWeb |
| Installfeature | Install-SPFeature |
| Listlogginglevels | Get-SPLogLevel |
| Listqueryprocessoroptions | 无 |
| Listregisteredsecuritytrimmers | Get-SPEnterpriseSearchSecurityTrimmer |
| Localupgradestatus | 无。 但是, Get-SPPendingUpgradeActions 提供了类似的信息。 |
| Managepermissionpolicylevel | 无 |
| Mergecontentdbs | Move-SPSite |
| Migrateuser | Move-SPUser |
| Osearch | 对于 Osearch 参数 farmcontactemail、farmperformancelevel、farmserviceaccount 和 farmservicepassword,使用 Get-SPEnterpriseSearchService 和 Set-SPEnterpriseSearchService cmdlet。 对于 Osearch 参数 start 和 stop,分别使用 Start-SPEnterpriseSearchServiceInstance 和 Stop-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 | Set-SPSite 使用 UserAccountDirectoryPath 参数。 |
| 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 |