Delete domain user for client computer

Is there a script to delete all previous logged on domain users except specific users from client computers?

Hello @slim2018

Please refer the following link for the script:

Thank you

Thanks for that, but i need something more like a script that delete users are inactive for so many days, something similar to delprof2.