Please share the PowerShell script you already have or any attempt. If you don't have anything, please invest the time to Google/Bing for PowerShell scripts which are solving the same or a similar problem. Try them out, post your attempt here and ask specific questions for us to help you. We don't have the time and resources to script something up for you from scratch from some vague requirements.
Thanks for your understanding and please continue to post your questions.