<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00008E2ndQCAROkta Classic EngineAdministrationAnswered2025-09-13T09:01:51.000Z2022-10-14T15:08:21.000Z2023-03-03T14:29:53.000Z

StevenY.58531 (Customer) asked a question.

Group Rule to exclude deactivated users from a group

Hi Everyone,

 

Trying to use the Okta Expression language to create a group rule that adds users with a specific UPN suffix but excludes deactivated users but cannot seem to find the right expression

 

IF String.stringContains(user.login, "@Contoso.com") AND (user.login, Deactivated) - Something like that but cannot determine the second part with the correct expression.

 

Basically, I'm creating a workflow to update 365 attributes to our federated users from Active Directory, but the error handling fails instantly on deactivated users with a 404 error, but I cannot get the error handling to skip past those and continue for the rest of the list, so figured, we would modify the group population rule to exclude deactivated users.

 

Thank you for the help.


  • SteveS.00405 (GoCardless)

    Found this: https://support.okta.com/help/s/question/0D51Y0000AZZxKRSQ1/expression-for-user-status?language=en_US

     

    Looks like user.status can't be used.

     

    What I've done is create a new Okta user attribute called user.userStarted = Boolean.

    Then with Okta Workflows when suspending the user I change it from True to False.

     

    So your expression would be:

    IF String.stringContains(user.login, "@Contoso.com") AND user.userStarted==true

     

    The user would be removed from the group if user.userStarted==false

     

    Hope it helps.

    Expand Post
  • StevenY.58531 (Customer)

    Bummer. Thanks Steve. Need to figure out another way to accomplish this then.

  • JohnPaulT.67567 (Customer)

    Do your deactivated users reside in a different AD OU? Maybe you can look at the AD distinguished name of the account

  • PriyankaD.37395 (BMC Software)

    Hi Steven,

    Did you find a way to exclude the deactivated users? Let us know.

    Thanks,

    Priyanka

  • a0n5s (a0n5s)

    @StevenY.58531 (Customer)​ Our customer also want this feature. but still not the expression not support user status. I create the case recently.

    Image is not available
    I will create a new feature in ideas.okta.com. hope can vote it.

    Expand Post
This question is closed.
Loading
Group Rule to exclude deactivated users from a group