Get-CMResource

Get a Configuration Manager resource.

Syntax

Get-CMResource
   [-Fast]
   [[-ResourceId] <Int32>]
   [-ResourceType <ResourceType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

The Get-CMResource cmdlet gets a Configuration Manager resource, such as a device or a user.

For more complete data, use Get-CMDevice or Get-CMUser. For devices, it queries the SMS_R_System class. If you use Get-CMDevice -Resource the output is the same as Get-CMResource.

Note

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

Examples

Example 1: Get a resource by ID

This command gets the resource with the ID 2097152000 and doesn't return lazy properties.

Get-CMResource -ResourceID "2097152000" -Fast

Example 2: Get all user resources

This command gets all user resources.

Get-CMResource -ResourceType User

Parameters

-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

-Fast

Add this parameter to not automatically refresh lazy properties. Lazy properties contain values that are relatively inefficient to retrieve. Getting these properties can cause additional network traffic and decrease cmdlet performance.

If you don't use this parameter, the cmdlet displays a warning. To disable this warning, set $CMPSSuppressFastNotUsedCheck = $true.

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

-ResourceId

Specifies the ID of a resource. For example, 16780010.

Type:Int32
Aliases:Id
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceType

Specifies the resource type.

Type:ResourceType
Accepted values:None, UnknownResource, UserGroup, User, System
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

IResultObject