function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Venkatesh LVenkatesh L 

How to Create a batch class which runs daily with the help of scheduled class and deactivates users whose last login date is greater than 10 days

List<User> users = [Select LastLoginDate , IsActive, Id From User where LastLoginDate <];
for(User u : users)
	u.IsActive = False;
update users;

use the above query in your batch class and create scheduler class and activate the scheduler daily using apex scheduler button