Get-CMResource

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

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId

Specifies the ID of a resource.

Type:Int32
Aliases:Id
Required:False
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IResultObject#SMS_Resource