Set-SPServer
更改服务器的角色。
语法
Set-SPServer
[-Identity] <SPServerPipeBind>
[-AssignmentCollection <SPAssignmentCollection>]
[-Role <SPServerRole>]
[-Status <SPObjectStatus>]
[<CommonParameters>]
说明
Set-SPServer cmdlet 通过使用 Role 参数在服务器场中更改服务器的角色。 SharePoint Server 2016 中的新 cmdlet,SharePoint Server 2019用于 MinRole。
示例
--------------------示例---------------------
Set-SPServer -Role SingleServerFarm
本示例将服务器的角色更改为 SingleServerFarm。
参数
-AssignmentCollection
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
注意:使用 Global 参数时,所有对象都包含在全局存储中。 If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Identity
指定服务器场中服务器的名称。
Type: | SPServerPipeBind |
Aliases: | Address |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Role
指定要更改的服务器角色的名称。
有效值为:
- WebFrontEnd
- Application
- SingleServerFarm
- 分布式缓存
- 搜索
- 自定义警报
- ApplicationWithSearch
- WebFrontEndWithDistributedCache
Type: | SPServerRole |
Accepted values: | Application, ApplicationWithSearch, Custom, DistributedCache, Search, SingleServerFarm, WebFrontEnd, WebFrontEndWithDistributedCache |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Status
设置场中服务器的状态。
Type: | SPObjectStatus |
Accepted values: | Online, Disabled, Offline, Unprovisioning, Provisioning, Upgrading, Patching |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
输入
Microsoft.SharePoint.PowerShell.SPServerPipeBind
Microsoft.SharePoint.PowerShell.SPAssignmentCollection
输出
System.Object