Get-​CM​Resource

Gets a resource.

Syntax

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

Description

The Get-CMResource cmdlet gets a resource. A resource can be a user or a device.

Examples

Example 1: Get a resource by ID

PS C:\> Get-CMResource -ResourceID 2097152000 -Fast

This command gets the resource with the ID 2097152000. It does not return lazy properties.

Example 2: Get all user resources

PS C:\> Get-CMResource -ResourceType User -Fast

This command gets all user resources. It does not return lazy properties.

Optional Parameters

-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
-Fast

Indicates that the cmdlet does not automatically refresh lazy properties.Lazy properties contain values that are relatively inefficient to retrieve which can cause additional network traffic and decrease cmdlet performance. If lazy properties are not used, this parameter should be specified.

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
-ResourceId

Specifies the ID of a resource.

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

Specifies the resource type. Valid values are: - None

  • UnknownResource
  • UserGroup
  • User
  • System
Type:ResourceType
Parameter Sets:None, UnknownResource, UserGroup, User, System
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IResultObject#SMS_Resource