quite tired,
but if the name of the folder is really a username (samaccountname) and users still rely on the original data (you are able to delete the copy and re-run robocopy), it should work...
- replace path in $source with your source parrent folder of the user folders
- replace path in $targetpath with your intended destination parrent path
- replace "your_domain" in $domainuser with your domain
- add your robocopy options
another approach, if the user is owner of the folder, could be read that attribute and try to rename all the folders using it
$source = "path"
get-childitem $source -directory | foreach-object {
$foldername = $_.name
$sourcepath = "$source\$foldername"
$targetpath = "path\$foldername"
$domainuser = "your_domain\$foldername"
new-item -path $targetpath -itemtype directory -erroraction silentlycontinue | out-null
$acl = get-acl $targetpath
$rights = "modify"
$inheritance = "containerinherit, objectinherit"
$propagation = "none"
$accesscontrol = "allow"
$rule = new-object system.security.accesscontrol.filesystemaccessrule("$domainuser","$rights","$inheritance","$propagation","$accesscontrol")
$acl.addaccessrule($rule)
set-acl $targetpath $acl
robocopy $sourcepath $targetpath
}