我可以在服务器之间交换ACL吗?

时间:2016-07-25 20:16:23

标签: powershell

是否可以在服务器A上获取路径的ACL,将其存储在变量中并在服务器B上设置完全相同的ACL?

$session = New-PSSession $remoteIIS -Credential $AdminCred2 -Authentication Negotiate -Port 5985
$acl = Invoke-Command -Session $session -ArgumentList $sourceACL,$Name {
    param($sourceACL,$Name)
    $sACL = Get-Acl -Path ($sourceACL.Get_Item($Name))
    return $sACL
}
$rmps = Remove-PSSession $session
$setacl = set-acl -Path $spp -AclObject $acl -ErrorAction Stop

这是我的代码,它应该在我的路径上设置输入ACL,但它不会像IUSR那样部署在源acl上具有读/写访问权限的用户。它根本不会部署它们。

如何在服务器之间交换ACL数据?

0 个答案:

没有答案