Thanks for recommandation and suggestion, problem is at my work place server where I suppose to run this script unfortunately those modules are not installed and I don't have the right to do that.
If You guys have any suggestion regarding above code please!!!
Cheers!