Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Automated copy specified dir from all users personal directories to new location

$
0
0

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-recurse

I'm thinking I...


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>