Remove-CMSecondarySite

Removes a secondary site from Configuration Manager.

Syntax

Remove-CMSecondarySite
      -Action <ActionType>
      [-Force]
      -InputObject <IResultObject>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSecondarySite
      -Action <ActionType>
      [-Force]
      -Name <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMSecondarySite
      -Action <ActionType>
      [-Force]
      -SiteCode <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-CMSecondarySite cmdlet removes a secondary site from Configuration Manager. A secondary site has no site database of its own. Instead it is connected to a primary site and sends client data to the primary site for storage.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Remove a secondary site upgrade by using a site name

PS XYZ:\> Remove-CMSecondarySite -Action Delete -SiteName "ClientSecSiteUpgrade03"

This command deletes a secondary site named ClientSecSiteUpgrade03. Because the Force parameter is not specified, you must confirm the action before it is performed.

Parameters

-Action

Specifies an action type for the deletion. The acceptable values for this parameter are:

  • Delete. Removes the reference to the secondary site from the database.
  • Uninstall. Removes the reference to the secondary site from the database and triggers an uninstall action at the secondary site server.
Type:ActionType
Accepted values:Uninstall, Delete
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-Force

Forces the command to run without asking for user confirmation.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-InputObject

Specifies a secondary site object. To obtain this object, use the New-CMSecondarySite cmdlet.

Type:IResultObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of a secondary site.

Type:String
Aliases:SiteName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SiteCode

Specifies a code for a secondary site.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject