User is inactive in Azure AD but still active in ServiceNow

Rairai31
Giga Guru

Hi All, 

 

We are trying to integrate Azure AD to ServiceNow via OAuth Connection for the syncing of users. We also created a REST message and a scheduled job. But while testing, we found out that when we deactivate a user in the Azure portal, user is still active in the ServiceNow. It is not updating. Can you help us how we can achieve this? Thank you.

Rairai31_0-1701147515760.png

Scheduled job:

Rairai31_1-1701147662436.png

 

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hi @Rairai31 

In your script, I don't see you are updating active field, you need to add that in order to reflect it properly.

 

 

Best Regards
Aman Kumar

View solution in original post

4 REPLIES 4

Aman Kumar S
Kilo Patron

Hi @Rairai31 

In your script, I don't see you are updating active field, you need to add that in order to reflect it properly.

 

 

Best Regards
Aman Kumar

Thank you very much @Aman Kumar S. But in the rest test message result it does not have any field for active so I am not sure what is the field name for that. We don't use auto provisioning in service now for users we use graph api. Do you know where can I see the active field? Thank you.

Org uses userAccountControl attribute which has numericals codes. Generally, if the value is 512, 514 the user acc is considered inactive, you can use that to maintain the active flag.

 

Best Regards
Aman Kumar

Hi @Aman Kumar S,

 

I really appreciate your response and helping hand. I was able to figure it out using this documentation from Microsoft - https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0 and used the accountEnabled property. Thank you.