The functionality is working fine. But IUser and getServiceUserFactory() methods are showing depreciated. So, please let me know the correct method(without depriciate) of these two.

And one more function is getting the user's last successfull logon date using IUserAccount getLastSuccessfullLogonDate() method and setLastSuccessfulLogonDate(date) method. In those methods also showing depreciated. But functionality is working fine.