# How to access Resource Assignments (OwnerAssignedResourceTypes) from C# expressions?

**URL:** <https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074>\
**Category:** Identity Manager Discussions & Questions\
**Tags:** identity-manager, expressions\
**Created:** [March 23, 2026, 5:06pm UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074 "2026-03-23T17:06:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamil.Wojenkowski](https://yyz1.discourse-cdn.com/netwrix/user_avatar/community.netwrix.com/kamil.wojenkowski/32/492_2.png) [@Kamil.Wojenkowski](https://community.netwrix.com/u/Kamil.Wojenkowski)\
**Post date:** [March 23, 2026, 5:06pm UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/1 "2026-03-23T17:06:50Z")

</div>

Hello,

I’m configuring automatic assignment rules and computed properties in Netwrix Identity Manager.

From the REST API, we can access the OwnerAssignedResourceTypes of an Identity.

For example, using this API call:

> /api/Resource/Directory\_User/{id}?api-version=1.0  
> &squery= join OwnerAssignedResourceTypes art  
> join art.Resource artre  
> join art.Role artr  
> …  
> &Path=/Custom/Resources/Directory\_User/ViewOwnedResources

This returns all resource type assignments for the identity, including the ResourceType code, provisioning state, workflow state, etc.

**My question:**

Is it possible to access these resource assignments (the same ones returned under `OwnerAssignedResourceTypes` in the API) from within a **C# expression**?

If yes:

- What is the supported syntax to read those properties?

- What entity or collection name do they appear under in the C# rule engine?

If not:

- What is the recommended method to detect whether a resource type is already assigned to an identity?

Thank you!

---

<div class="post-metadata">

**Author:** ![hazem.taouai](https://yyz1.discourse-cdn.com/netwrix/user_avatar/community.netwrix.com/hazem.taouai/32/158_2.png) [@hazem.taouai](https://community.netwrix.com/u/hazem.taouai)\
**Post date:** [August 14, 2026, 7:01am UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/4 "2026-08-14T07:01:09Z")

</div>

Hello Kamil,

What is the goal you want to achieve in here?

Where will the C# expression be used?

Regards

Hazem

---

<div class="post-metadata">

**Author:** ![Maxxil](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Maxxil](https://community.netwrix.com/u/Maxxil)\
**Post date:** [August 17, 2026, 7:17am UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/5 "2026-08-17T07:17:30Z")

</div>

> [@Kamil.Wojenkowski](#):
>
> Is it possible to access these resource assignments (the same ones returned under `OwnerAssignedResourceTypes` in the API) from within a **C# expression**?
> 
> If yes:

Hello,

We have the same need.  
Some time, we want to calculate a Scalar/Aspect, which depends on multiple SingleRoles.

Sincerely,

---

<div class="post-metadata">

**Author:** ![hazem.taouai](https://yyz1.discourse-cdn.com/netwrix/user_avatar/community.netwrix.com/hazem.taouai/32/158_2.png) [@hazem.taouai](https://community.netwrix.com/u/hazem.taouai)\
**Post date:** [August 17, 2026, 3:53pm UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/6 "2026-08-17T15:53:37Z")

</div>

Hello,

I’m not sure this is possible.

You might need to open a new feature request.

Regards

Hazem

---

<div class="post-metadata">

**Author:** ![Kamil.Wojenkowski](https://yyz1.discourse-cdn.com/netwrix/user_avatar/community.netwrix.com/kamil.wojenkowski/32/492_2.png) [@Kamil.Wojenkowski](https://community.netwrix.com/u/Kamil.Wojenkowski)\
**Post date:** [August 28, 2026, 11:16am UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/7 "2026-08-28T11:16:33Z")

</div>

Hello Hazem,

It’s a bit difficult to explain the original requirement, but I will try.

At one customer, when a user needed to be migrated, we received the information from the HR system. The migration itself had to be performed manually rather than through NIM.

The challenge was that, as soon as the HR data indicated that the user no longer required the account in a first domain, NIM would apply the current rules and deprovision the account. In reality, the account still needed to exist until the manual migration to a second domain was completed.

In this customer’s environment, NIM only had read access to the second domain, so it could not manage the migration process itself.

My goal was therefore to access the assigned resource types in a C# expression and use that information to prevent the account from being deprovisioned while it was still assigned and awaiting migration.

The expression would be used in a computed property that served as a dimension for the resource type assignment.

This is probably overengineered, but I didn’t see any other option at the time.

---

<div class="post-metadata">

**Author:** ![hazem.taouai](https://yyz1.discourse-cdn.com/netwrix/user_avatar/community.netwrix.com/hazem.taouai/32/158_2.png) [@hazem.taouai](https://community.netwrix.com/u/hazem.taouai)\
**Post date:** [November 23, 2026, 10:23am UTC](https://community.netwrix.com/t/how-to-access-resource-assignments-ownerassignedresourcetypes-from-c-expressions/126074/8 "2026-11-23T10:23:46Z")

</div>

Hi Kamil,

I don’t know if you managed to find a proper way to manage the account migration.

What I can propose is the following (if I understood your challenge):

1. add an offset of a 1 day or 2 to avoid the account to be removed when the HR data changes.
2. use an extension attribute in AD to set the migration status (empty (default value), in progress, completed)  
this attribute should be mapped with an attribute (dimension) NIM “ex. Migration Status”.
3. Configure the AD query rule in NIM to be based on this dimension (Migration Status = in progress)
4. When the It teams finishes the migration of the account they just need to update the value of the extension attribute in AD to “completed”  
This will invalidate the rule and set the account for deprovisioning (the offset still applies)

Reagrds

Hazem
