Remove-CMSecondarySite

Removes a secondary site from Configuration Manager.

Syntax

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

Description

The Remove-CMSecondarySite cmdlet removes a secondary site from Microsoft System Center 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.

Examples

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

PS C:\> 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.

Required 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
Parameter Sets:Uninstall, Delete
Position:Named
Default value:None
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
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a secondary site.

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

Specifies a code for a secondary site.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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