Invoke-CMDeviceAction

Initiates a remote action on a mobile device.

Syntax

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

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
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies an ID for a device.

Type:Int32
Aliases:ResourceId
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
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a device.

Type:String
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-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
-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
-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

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