Edit

Share via


Start-CMObjectTracking

Start tracking SMS Provider objects used by PowerShell to reclaim them.

Syntax

Default (Default)

Start-CMObjectTracking
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use Start-CMObjectTracking to track SMS Provider objects used by the PowerShell runtime. Then use Disconnect-CMTrackedObject to clean up these resources when they're no longer needed.

When you run Start-CMObjectTracking, the PowerShell runtime tracks IResultObject objects created by Configuration Manager cmdlets. For objects that aren't manually cleaned up with .Dispose(), reclaim them by using Disconnect-CMTrackedObject against an individual object.

Once an object is reclaimed, it can no longer be reused or passed to another cmdlet through the object pipeline.

Stop-CMObjectTracking can be used to turn off object tracking. Previously allocated objects remain active.

Unclaimed resources can cause the SMS Provider to raise quota violation errors. These quota issues typically manifest from working with large sets of SMS Provider objects or in long-running environments.

Note

This feature is experimental and may be subject to change or removal in a future release.

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

Examples

Example 1

The first command turns on object tracking. The second command reclaims a single object specified by the $obj variable. The third command reclaims all tracked objects. The last command turns off object tracking.

Start-CMObjectTracking

# Reclaim a single tracked object
$obj | Disconnect-CMTrackedObject

# Reclaim all tracked objects
Disconnect-CMTrackedObject -All

Stop-CMObjectTracking

Parameters

-Confirm

Add this parameter to prompt for confirmation before the cmdlet runs.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object