Thank you both for the idea and scrpit. I am working on this..
I understand that the script given will work if I am connected to server only. However the issue is I can not connect to the servers. So I need to run this (similer) code against all servers (name will be found in a table) using some batch
If you have furher idea.. plz share
Thanks again