By: Harrison Dragoo user 19 Jan 2017 at 1:24 p.m. CST

4 Responses
Harrison Dragoo gravatar
I would like to know how to set the user status when pulling from active directory with the cache refresh. I can map userAccountControl to the UserStatus field however in AD this only stores a number. I am unsure which attribute to use.

By Aliaksandr Samuseu staff 19 Jan 2017 at 1:31 p.m. CST

Aliaksandr Samuseu gravatar
Hi, Harrison. Accounts pulled in from AD should already be set to "active". You can change values of attributes by writing your own custom CR script in jython. There is already a pre-packaged example of simple script in your instance.

By Aliaksandr Samuseu staff 19 Jan 2017 at 1:36 p.m. CST

Aliaksandr Samuseu gravatar
>I can map userAccountControl to the UserStatus field however in AD this only stores a number. I am unsure which attribute to use. Gluu uses `gluuStatus` attribute of its user entries to store this, so that what you should use for mapping. Note that it expects either "active" or "inactive" string values there, so I'm not sure whether direct mapping will work. I'm also not sure when exactly CR sets `gluuStatus` to active during the pull cycle, so there is a chance a simple mapping will be overridden by it in the end. I.e., if your intention is to set it to "inactive" first, as CR sets all imported accounts to "active" automatically. With custom CR scripts you should be able to override any automated behaviour, though.

By Harrison Dragoo user 19 Jan 2017 at 3:43 p.m. CST

Harrison Dragoo gravatar
What I would like to do would be to set a user to inactive when they are deactivated within Active Directory. however I am unsure how to accomplish that goal at the moment as Active directory does not have a string that is set to "active" or "inactive" that I can find.

By Aliaksandr Samuseu staff 19 Jan 2017 at 6:55 p.m. CST

Aliaksandr Samuseu gravatar
Then your only option is to employ a custom CR script. There is "Manage custom scripts" page where you'll find Cache Refresh scripts tab with a simple example depicting the concepts. You also can study source code on github, learning what capabilities different classes and functions have, if you'll need a more complex logic.