Invoke-CMDeviceAction

Initiates a remote action on a mobile device.

Syntax

Invoke-CMDeviceAction
      [-Id] <Int32>
      [-Action] <DeviceActionType>
      [-Confirm]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-PassThru]
      [-WhatIf]
      [<CommonParameters>]
Invoke-CMDeviceAction [-InputObject]  [-Action]  [-Confirm]
 [-DisableWildcardHandling] [-ForceWildcardHandling] [-PassThru] [-WhatIf] []
Invoke-CMDeviceAction [-Name]  [-Action]  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-PassThru] [-WhatIf] []

Description

The Invoke-CMDeviceAction cmdlet initiates a remote action, such as locking or resetting a PIN for, a mobile device. This cmdlet only works on mobile devices.

Examples

Example 1: Lock a mobile device

PS C:\> Get-CMDevice -Name "WindowsPhone0401" | Invoke-CMDeviceAction -Action Lock

This command gets the device object named WindowsPhone0401 and uses the pipeline operator to pass the object to Invoke-CMDeviceAction, which locks the device.

Example 2: Reset the PIN for a mobile device

PS C:\> Invoke-CMDeviceAction -Name "WindowsPhone0402" -Action PinReset -PassThru

This command resets the PIN for the device named WindowsPhone0402.

Required Parameters

-Action

Specifies the action you want to initiate on the device. Valid values are: - Lock

  • PinReset
  • BypassActivationLock
  • RequestNewActivationLockCode
  • Unknown
Type:DeviceActionType
Parameter Sets:Lock, PinReset, BypassActivationLock, RequestNewActivationLockCode
Required:True
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies an ID for a device.

Type:Int32
Aliases:ResourceId
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a device object. To obtain a device object, use the Get-CMDevice cmdlet.

Type:IResultObject
Aliases:Device
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a device.

Type:String
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False