---
sourceDocument: Yokohama ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/servicenow-platform

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Add to Device Collection activity

# Add to Device Collection activity {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The Add to Device Collection activity adds the specified device into a Microsoft System
Center Configuration Manager (SCCM) device collection.
The Add to Device Collection activity uses the [Powershell activity template](https://www.servicenow.com/docs/T3oY9tzS7x0vGVPp_ruWXw#t_CreateAPowershellActivity "Create a custom PowerShell activity return data to a workflow from a host using Microsoft PowerShell.")
to add a specified device to an SCCM device collection. The activity is configured to use
a MID Server with Powershell capabilities and to run a MID Server script called
AddToDeviceCollection.ps1 to edit the collection.{#r_AddToDeviceCollectionActivity__p_AccessSSHCustomActivities}

To access this activity in the Workflow Editor, select the Custom
tab, and then navigate to Custom ActivitiesSystem Center Configuration Manager (SCCM).  
Note:  
The Add to Device Collection activity does not use pre-processing or post-processing scripts.

## Input variables

{#r_AddToDeviceCollectionActivity__table_k4g_y11_1q__entry__2}

| Variable | Description |
|-|-|
| sccmServer | The fully qualified domain name (FQDN) of the SCCM server. |
| collection | Name of the device collection. |
| device | Name of the device to add to the collection. |
[Table 1. Add to Device Collection input variables]

{#r_AddToDeviceCollectionActivity__table_k4g_y11_1q}

## Output variables {#r_AddToDeviceCollectionActivity__table_SCCMActivityOutputVariables}

{#r_AddToDeviceCollectionActivity__table_bsj_mg5_2s__entry__2}

| Variable | Description |
|-|-|
| output | Variable that contains a value that is passed to other activities in the workflow. |
| error | Variable that contains the activity output error message. |
[Table 2. Add to Device Collection output variables]

{#r_AddToDeviceCollectionActivity__table_bsj_mg5_2s}

## Conditions {#r_AddToDeviceCollectionActivity__table_SCCMActivityConditions}

{#r_AddToDeviceCollectionActivity__table_cn3_rwc_3s__entry__2}

| Condition | Description |
|-|-|
| Success | Activity successfully added the device to the SCCM device collection. |
| Failure | Activity failed to add the device to the SCCM device collection. |
[Table 3. Add to Device Collection conditions]

{#r_AddToDeviceCollectionActivity__table_cn3_rwc_3s}

*[\>]: and then


