# User status changes

**URL:** https://community.openiam.com/t/user-status-changes/129
**Category:** Identity Life Cycle Management
**Created:** [May 12, 2025, 2:12pm UTC](https://community.openiam.com/t/user-status-changes/129 "2025-05-12T14:12:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bizz](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@Bizz](https://community.openiam.com/u/Bizz)
#### Post date: [May 12, 2025, 2:12pm UTC](https://community.openiam.com/t/user-status-changes/129/1 "2025-05-12T14:12:21Z")

</div>

Dear community,

I need some advice regarding user statuses.  
I’m using the following four:  
**ACTIVE**  
**PENDING\_START\_DATE**  
**LEAVE**  
**DISABLED**

When I set an identity to any of the last three statuses, the account in the Active Directory managed system is set to **Disabled** , which is the desired behavior.  
However, if I then manually trigger a synchronization to AD, the target accounts get unlocked.  
How is that possible?

Thank you in advance.  
Jan

---

<div class="post-metadata">

### Author: ![pradeep.bhalla](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@pradeep.bhalla](https://community.openiam.com/u/pradeep.bhalla)
#### Post date: [May 24, 2025, 1:03am UTC](https://community.openiam.com/t/user-status-changes/129/2 "2025-05-24T01:03:02Z")

</div>

Hi Jan,

We currently have a policy map script (enabled.groovy) configured for AD (via PowerShell) that manages account enablement based on user status changes in OpenIAM. Specifically, it disables the AD account when a user’s status changes from:

ACTIVE to LEAVE

ACTIVE to DISABLED

ACTIVE to PENDING\_START\_DATE

This is the expected and correct behavior based on the logic defined in the script.

(We’ve attached the script here for reference.)

The issue arises when a user sync is manually triggered from AD to OpenIAM. In such cases, previously disabled users in both OpenIAM and AD appear to get re-enabled.

This happens because:

In the AD user sync transformation script, the status is set to ACTIVE for all incoming users.

Additionally, the “Provision to Target Systems” checkbox is likely enabled in the AD user sync configuration.

As a result:

During the sync, the user’s status in OpenIAM is overwritten to ACTIVE.

Since provisioning is enabled, this status update triggers a provisioning request to AD — which ends up re-enabling the user account.

Recommended Fix

To avoid this unintended behavior:

Disable the “Provision to Target Systems” checkbox in the AD user sync configuration.

This will ensure that status updates during sync do not trigger re-provisioning to AD.

We can help you update the AD user sync transformation script so that it:

Checks the current user status in AD.

Avoids changing the status to ACTIVE if the user is already disabled.

This will prevent accidentally reactivating disabled accounts during sync.

Please let us know the exact use case you’re trying to achieve, and we’ll help you tailor the script accordingly.

---

<div class="post-metadata">

### Author: ![pradeep.bhalla](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@pradeep.bhalla](https://community.openiam.com/u/pradeep.bhalla)
#### Post date: [May 24, 2025, 1:05am UTC](https://community.openiam.com/t/user-status-changes/129/3 "2025-05-24T01:05:06Z")

</div>

[enabled.txt](https://community.openiam.com/uploads/short-url/9C66pqYwUdxhmwdeidbv9cQ5ehd.txt) (1.6 KB)
