Add roles to user in target system using REST via Powershell connector

Hi,

we are running 9.1.2 (and soon 9.2).

We have a SaaS service where we manage the user via REST API and have already written a Powershell connector to build the user life cycle. Also, we have a class to read "locations" from the target system. Now, I need to read and modify the assignment from a user to a "location". Is there any documentation or whitepaper how this could be done?

From my understanding, I would need to read the information the target system and store it in UNSAccountBHasUNSGroupB oder UNSAccountBInUNSGroupB? Also writing a dedicaded class for UserInLocation?

Thanks for help or suggestions.

Best, Denny