How to enable Users by custom script

I want to enable users by our custom script. How do I archive it ?
This is very import.
Appreciate early comments.