WOW, another post about monitoring SQL server and asking for the same activities.....we do not write scripts here, please look at the other posts right on the front page asking the same thing as you are.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''