This week just finish teaching the ICOMM course, it reminds me a problem that I’ve been facing in a CUCM Active Directory integration project 2 years ago. The problem was after synchronizing the AD, as we have some time lag that some users are not ready in the AD, so those users become inactive in the CUCM.
As there should be a grace period that the CUCM will not immediately remove those users, so they are still in the CUCM’s configuration. However, as those users become inactive, they are not able to login the extension mobility.
Even we disable the AD sync, those users will not automatically change back to active again. Also, in the CUCM admin page, there is no option to reactive them. We tried to call up the TEC support to see if there is any “unofficial” way to reactive them. Yet, we can’t get any answer.
Eventually, I figure out that there is a solution to use the undocumented “run sql” command to directly change the CUCM database.
The following shows the way.
In CUCM, create 2 users that doesn’t exist in the AD before tuning on the AD sync, using the CUCM command line interface, you can use the following command to show the status:
admin:run sql select userid,status from enduser
userid status
============= ======
user2 1
user1 1
Now configure the AD sync and perform the sync once.

After the synchronization completes, these 2 users become inactive:

Double check using the CLI, the status also shown to be changed with new value as 2:
admin:run sql select userid,status from enduser
userid status
============= ======
user2 2
user1 2
If I tried to login the EM using one of the user account, you will get an error.

Even disable the AD sync, the user account still in inactive state.
Now using the CLI, execute the following command (optionally, you can add 'where userid="user"' to change a particular user):
admin:run sql update enduser set status=1
Rows: 2
admin:run sql select userid,status from enduser
userid status
============= ======
user2 1
user1 1
Check the status under the CUCM web interface, now they are back.

Also, able to login successfully.