PowerShell - Ownership an Profilcontent übergeben
$names = "user123","user345"
$path_prefix = '\\filer\share$'
foreach ($this_name in $names)
{
Write-Host "$this_name"
$path = "$path_prefix\$this_name.V6"
$this_acp = (New-Object -TypeName System.Security.Principal.NTAccount("$this_name"))
Get-ChildItem -Path $path -Recurse -Force | ForEach-Object {
$item = $_
$this_acl = $item.GetAccessControl()
$this_acl.SetOwner($this_acp)
$item.SetAccessControl($this_acl)
}
}