Hello Bojan Zivkovic,
Thank you for posting in Q&A forum.
From the links below, I can see the method for temporary membership in Domain Admins group is Privileged Access Management Feature.
https://woshub.com/temporary-membership-in-active-directory-groups/#google_vignette
Except Privileged Access Management Feature, maybe one way is the manual setting via adding member to AD group or removing member from AD group and allow access the domain machine or deny allow the domain machine.
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.