Hello Jalle,
Thank you for posting in Q&A forum.
Is your machine in one local AD domain? If so, you can remove /disjoin the machine from AD domain based on the steps below:
Right click this PC\Properties\Advanced system settings\System Properties\ click Change button (To rename this computer or change its domain or workgroup, click Change).
Click Workgroup and type a name of workgroup.
Then restart the machine, after that your machine will be in workgroup.
If your machine is in Azure AD (Microsoft Entra ID), you can try the steps in the link below.
https://learn.microsoft.com/en-us/entra/external-id/leave-the-organization
https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/cancel-azure-subscription
If your machine is in Azure AD (Microsoft Entra ID), if it does not work after you try the steps in the link above, I suggest you can also add new tag (Microsoft Entra or Microsoft Entra ID).
I hope the information above is helpful.
If you have any questions or concerns, please feel free to let us know.
Best Regards,
Daisy Zhou
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.