# Locating a System Group ID The System Group ID is required to auto associate a system to a system group in JumpCloud during zero-touch enrollment. ![systemGroupID example](https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Files/systemGroupID.png?raw=true) To find the `systemGroupID` for a JumpCloud system group navigate to the "GROUPS" section of the JumpCloud admin portal and select the system group to bring up the system group details. Within the URL of the selected command the systemGroupID will be the 24 character string between 'system/' and '/details'. The JumpCloud PowerShell command [Get-JCGroup](https://github.com/TheJumpCloud/support/wiki/Get-JCGroup) can also be used to find the systemGroupID. The systemGroupID is the 'id' value which will be displayed for each JumpCloud group when Get-JCGroup is called. Update the `systemGroupID=''` variable with this value for all below options. To add systems to more then one system group simply create duplicate `groupAddition` curl examples with different systemGroupIDs. ## Option 1: Addition to exiting zero touch workflows Insert the below code into the script [jc_account_association](https://github.com/TheJumpCloud/support/blob/master/zero-touch/Jamf%20Pro/scripts/jc_account_association.md) on line 25 above `## Get JumpCloud UserID`. Be sure to update the `systemGroupID=''` variable with a valid system group id. ### Jamf addition ```bash ## Populate below variable before running command systemGroupID='' ## Adds the JumpCloud system to the JumpCloud group groupAddition=$( curl -s \ -X 'POST' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: '${JCAPIKey}'' \ -d '{"op": "add","type": "system","id": "'${systemID}'"}' \ "https://console.jumpcloud.com/api/v2/systemgroups/${systemGroupID}/members" ) err=$? if [[ ${err} -ne 0 ]]; then echo "Could not add system to system group id: ${systemGroupID} error=${err}" exit 1 else echo "System added to system group id: ${systemGroupID}" fi ``` ### Workspace ONE UEM addition Update script [jc-zero-touch.sh](https://github.com/TheJumpCloud/support/blob/master/zero-touch/Workspace%20ONE%20UEM/files%26actions/jc-zero-touch.sh) with below code on line 86 above `## Get JumpCloud UserID`. Be sure to update the `systemGroupID=''` variable with a valid system group id. ```bash ## Populate below variable before running command systemGroupID='' ## Adds the JumpCloud system to the JumpCloud group groupAddition=$( curl -s \ -X 'POST' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: '${4}'' \ -d '{"op": "add","type": "system","id": "'${systemID}'"}' \ "https://console.jumpcloud.com/api/v2/systemgroups/${systemGroupID}/members" ) err=$? if [[ ${err} -ne 0 ]]; then echo "Could not add system to system group id: ${systemGroupID} error=${err}" exit 1 else echo "System added to system group id: ${systemGroupID}" fi ``` ### Option 2: Stand alone workflow Use the below example to add systems to system groups in stand alone workflows. Be sure to update both the `JCAPIKey=''` variable and the `systemGroupID=''` variable. ```bash ## Populate below variable before running command JCAPIKey='' systemGroupID='' ## Get JumpCloud SystemID conf="$(cat /opt/jc/jcagent.conf)" regex='\"systemKey\":\"[a-zA-Z0-9]{24}\"' if [[ $conf =~ $regex ]]; then systemKey="${BASH_REMATCH[@]}" fi regex='[a-zA-Z0-9]{24}' if [[ $systemKey =~ $regex ]]; then systemID="${BASH_REMATCH[@]}" echo "JumpCloud systemID found SystemID: "$systemID else echo "No systemID found" exit 1 fi ## Adds the JumpCloud system to the JumpCloud group groupAddition=$( curl -s \ -X 'POST' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-api-key: '${JCAPIKey}'' \ -d '{"op": "add","type": "system","id": "'${systemID}'"}' \ "https://console.jumpcloud.com/api/v2/systemgroups/${systemGroupID}/members" ) err=$? if [[ ${err} -ne 0 ]]; then echo "Could not add system to system group id: ${systemGroupID} error=${err}" exit 1 else echo "System added to system group id: ${systemGroupID}" fi ```