Remove-CMGlobalCondition

Remove-CMGlobalCondition

Removes a global condition object.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMGlobalCondition -Id <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMGlobalCondition -Name <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMGlobalCondition -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-CMGlobalCondition cmdlet removes a global condition object.

Microsoft System Center 2012 Configuration Manager uses global conditions to represent business or technical conditions. Global conditions specify how to provide and deploy applications to client devices.

You can specify a global condition by name or ID or use the Get-CMGlobalCondition cmdlet to obtain a global condition object. You cannot remove read-only global conditions.

Parameters

-Force

Removes a global condition object without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of identifiers of global conditions. This value corresponds to the CI_ID property of a global condition object.

Aliases

CIId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a global condition object. To obtain a global condition object, use the Get-CMGlobalCondition cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies an array of names for global conditions. This value corresponds to the LocalizedDisplayName property of a global condition object.

Aliases

LocalizedDisplayName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecuredScopeNames<String>

Specifies a security scope of a global condition. You can use this parameter to narrow your specified global conditions by the current security scope.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Remove a global condition

This command removes a global condition named GC56. Because the command uses the Force parameter, the system does not prompt you before it removes the condition.

PS C:\> Remove-CMGlobalCondition -Name "GC56" -Force

Example 2: Remove a global condition using a variable

This example removes a global condition.

The first command uses the Get-CMGlobalCondition cmdlet to get the global condition named GC57 and stores it in the $CMGC variable.

The second command removes the global condition stored in that variable. This command does not use the Force parameter, so it prompts you for confirmation before it removes the global condition.

PS C:\> $CMGC = Get-CMGlobalCondition -Name "GC57"

PS C:\> Remove-CMGlobalCondition -InputObject $CMGC

Get-CMGlobalCondition

Set-CMGlobalCondition