Freigeben über


Remove-SCSMClassInstance

Remove-SCSMClassInstance

Removes a class instance.

Syntax

Parameter Set: Default
Remove-SCSMClassInstance [-Instance] <EnterpriseManagementInstance[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-SCSMClassInstance cmdlet permanently removes a class instance.

Parameters

-Instance<EnterpriseManagementInstance[]>

Specifies an instance of a configuration item object to be removed.

You can specify an EnterpriseManagementObject that is returned by the Get-SCSMClassInstance cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

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.

  • Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance

    You can pipe a class instance to the Instance parameter of the Remove-SCSMClassInstance cmdlet.

Outputs

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

  • None.

    This cmdlet does not generate any output.

Examples

Example 1: Remove all class instances of a specific type

These commands remove all class instances of type System.Windows.Computer when the instance class begins with the letter C.

PS C:\>$Cmp = Get-SCSMClass -Name Microsoft.Windows.Computer
PS C:\>Get-SCSMClassInstance -Class $Cmp|Format-Table PrincipalName,DisplayName
PS C:\>Get-SCSMClassInstance -Class $Cmp -Filter 'DisplayName -Like "C%"'
PS C:\>Get-SCSMClassInstance -Class $Cmp -Filter 'DisplayName -like "Computer1%"' | Remove-SCSMClassInstance
PS C:\>Get-SCSMClassInstance -Class $Cmp|Format-Table PrincipalName,DisplayName

New-SCSMClassInstance

Get-SCSMClassInstance

Update-SCSMClassInstance