I am looking to create a Powershell script that will copy the directory "emailArchive" from all my user's personal network drives to a secured location on the server under their name.
Directories current location
- From users computer - P:\emailArchive
- UNC - \\dc.domain.com\JSmith\emailArchive
- Server - d:\storage\users\JSmith\emailArchive
I want the directories"emailArchive" of each userto be copied to their respective location such as\\dc.doimain.com\secureLocation\JSmith
I understand the below script with do this one users but I'm looking to automate it to run threw all my AD users and if the directory/path exists then copy it.
Powershell
$SourceFolder="\\dc.domain.com\\JSmith\\emailArchive\\"$TargetFolder="\\dc.domain.com\\secureLocation\\JSmith\\emailArchive\\"Copy-Item$SourceFolder$TargetFolder-recurseI'm thinking I...