Get-CMDevice
Get-CMDevice
Gets a device of the Configuration Manager hierarchy.
Syntax
Parameter Set: ByName
Get-CMDevice [-Name <String> ] [ <CommonParameters>]
Parameter Set: ById
Get-CMDevice -Id <String> [ <CommonParameters>]
Parameter Set: SearchByIdMandatory
Get-CMDevice -CollectionId <String> [-Name <String> ] [ <CommonParameters>]
Parameter Set: SearchByIdMandatoryForViewInfectedClients
Get-CMDevice -ThreatId <String> [-CollectionId <String> ] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Get-CMDevice -CollectionName <String> [-Name <String> ] [ <CommonParameters>]
Parameter Set: SearchByNameMandatoryForViewInfectedClients
Get-CMDevice -ThreatName <String> [-CollectionId <String> ] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Get-CMDevice -Collection <IResultObject> [-Name <String> ] [ <CommonParameters>]
Parameter Set: SearchByValueMandatoryForViewInfectedClients
Get-CMDevice -Threat <IResultObject> [-CollectionId <String> ] [ <CommonParameters>]
Detailed Description
The Get-CMDevice cmdlet retrieves a device object that can be added to a collection.
To add a device to a collection use the Add-CMDeviceCollectionDirectMembershipRule cmdlet. For more information about Configuration Manager collections, see Introduction to Collections in Configuration Manager (https://go.microsoft.com/fwlink/p/?LinkID=259433) on TechNet.
Parameters
-Collection<IResultObject>
Specifies an object that represents the device collection. To get a device collection object, use the Get-CMDeviceCollection cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-CollectionId<String>
Specifies an ID for a collection in Configuration Manager.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-CollectionName<String>
Specifies a name of a collection in Configuration Manager.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Id<String>
Specifies the ID of the device.
Aliases |
ResourceID |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the device.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Threat<IResultObject>
Specifies an object that represents a threat.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ThreatId<String>
Specifies an ID for a threat.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ThreatName<String>
Specifies a name for a threat.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get a device
This command gets the device object named CMCEN-DIST02.
PS C:\> Get-CMDevice -Name "CMCEN-DIST02"