I see this as an excuse to get post-count up.
Carbon said that the code that we could have given could have been used for malicous purposes. It may not be the OP, but like he said, this is a public forum. ANYONE could see/use it.
OP, if you are a sys admin, then you should at least have enough knowledge of computers to make your own easy way to do what you first posted.