You need to sign in to do that
Don't have an account?
sweta kumari 55
How deactivate User using apex code ?
Hi,
In our organization we have 2000 users, I want to deactivate all the users except Administrator profile users.
How can I achieve this with peace of Apex code. If possible Could anyone please provide peace of code to achieve this and how to execute that code.
Thanks
Sweta
In our organization we have 2000 users, I want to deactivate all the users except Administrator profile users.
How can I achieve this with peace of Apex code. If possible Could anyone please provide peace of code to achieve this and how to execute that code.
Thanks
Sweta
You can try below sample code.
Also there is a simple way to export all the users via dataloader and then change the active field to false and upload using dataloader.
Please mark as Best Answer if above information was helpful.
Thanks,