Enroll a device again
Enroll a device again before its certificate's year is up, move it to its new record, and remove the old one.
API
Maya’s laptop was enrolled almost a year ago, and the date enroll printed then is close. Past it, the device client
stops connecting, and the laptop’s security events and AI tools agent go quiet. You want it enrolled again before
then, with no gap and no stale record left behind.
Enrolling again makes a new record, with a new device id and sensor id. The old record stays, and counts toward the realm’s device cap, until you remove it. Renewal over the device’s own connection, and re-enrollment into the same record, are planned.
Before you start
Section titled “Before you start”- You hold
MODIFYon the realm’s endpoint settings (RealmOwnerhas it; see Who can call), with your session in$CVYUH_SESSION(Call the API). - Someone with administrator rights on the laptop, and the device address and sign-in address it was enrolled with.
- The realm has room for one more device while both records exist (Device limits).
- The date to enroll again before:
enrollprinted it at the last enrollment, and the realm doesn’t show it.
Enroll it again
Section titled “Enroll it again”-
Find the old record. List the realm’s devices and pick the one whose
uidismaya-laptop:Terminal window curl https://foobar.cvyuh.com/api/v0/endpoint/ppm/v1 \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Keep its
idas the old device id, and note anyagentsrecorded on it. -
Make a token:
Terminal window curl https://foobar.cvyuh.com/api/v0/endpoint/ppm/v1/enrolment-tokens \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{"ttlHours": 4}' -
Enroll the laptop again, under a new name. While the old record exists, its sensor still holds the old name, and an enrollment under a name that’s held is refused:
Terminal window sudo /var/cvyuh/bin/cvyuh-uem enroll --name maya-laptop-2 \--server <device address> --token <enrollment token> \--issuer https://foobar.cvyuh.com/oauth2Terminal window sudo /Library/Cvyuh/bin/cvyuh-uem enroll --name maya-laptop-2 \--server <device address> --token <enrollment token> \--issuer https://foobar.cvyuh.com/oauth2It prints the new name and the next date to enroll again before. Note the date.
-
Restart the device client, so it connects with its new certificate:
Terminal window sudo systemctl restart cvyuh-uemTerminal window sudo launchctl kickstart -k system/com.cvyuh.endpoint -
Check the new record. List the realm’s devices again:
maya-laptop-2is there,activeand connected. Keep itsid. If agents were recorded on the old record, record them on the new one (Device records). -
Remove the old record, by the old device id:
Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/endpoint/ppm/v1/<old device id> \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm answers
202, and removes the old sensor registration with it.
Check it worked
Section titled “Check it worked”Reading the old record answers 404 once its removal has finished, and the list holds one record for the laptop,
maya-laptop-2, active and connected.
If it didn’t work
Section titled “If it didn’t work”| Symptom | Cause | Fix |
|---|---|---|
enroll is refused with 409, the name already held | The name is in use, by this laptop’s old enrollment or another device | Pick another name |
enroll is refused with 409, the realm at its cap | Both records need a place for a moment | Remove a device you no longer need, or have the cap raised (Device limits) |
The new record never shows connected | The client wasn’t restarted, or can’t reach the device address | Restart it (step 4), then see the device client’s Troubleshooting |
| The date passed before you got to it | The client stopped connecting at the date | Do the same steps: enrolling again works on an expired device too |
Undo it
Section titled “Undo it”Until step 6 the old record is still there, but the laptop now holds only its new certificate, so it can’t go back to the old record. If the new enrollment can’t connect, fix that first (above) and remove the old record after.
Related
Section titled “Related”- Device enrollment: every
enrolloption, and what each refusal means. - Device removal: what removing the old record does.
- What’s next for enrollment: renewal with no new token, and re-enrollment into the same record.