Switch-SPCertificate

将现有证书分配替换为新证书。

语法

Switch-SPCertificate
      [-Identity] <SPServerCertificatePipeBind>
      [-NewCertificate] <SPServerCertificatePipeBind>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

说明

你可能希望将 SharePoint 中证书的所有使用情况替换为其他证书。 例如,如果现有证书即将过期,并且已导入新证书来替换它。 使用Switch-SPCertificate cmdlet 将一个证书的分配替换为其他证书。 然后,SharePoint 中该证书的所有用法都将替换为不同的证书。

示例

------------示例-----------

Switch-SPCertificate -Identity "Team Sites Certificate (2020)" -NewCertificate "Team Sites Certificate (2021)"

此示例将“团队网站证书 (2020) ”证书的分配替换为“Team Sites 证书 (2021) ”证书。

参数

-Confirm

提示你在运行 cmdlet 之前进行确认。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Identity

要替换其分配的证书。

Type:SPServerCertificatePipeBind
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-NewCertificate

应替换标识参数指定的证书的所有分配的证书。

Type:SPServerCertificatePipeBind
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

显示在 cmdlet 运行时发生的情况。 此 cmdlet 未运行。

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. 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
Accept pipeline input:True
Accept wildcard characters:False