Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy ntfs permissions

Status
Not open for further replies.

ameyUK

IS-IT--Management
Dec 20, 2006
76
GB
hi there,

We copied 400 gb data from old server to new server. the folder and sub folder have different NTFS permissions. I was looking for a way to copy the ntfs permission from old server to new server. i came across this

dir c:\test -recurse | where {$_.PSIsContainer} | foreach {
$target= ($_.fullname).replace("C:\test","D:\test")
Get-Acl $_.Fullname | Set-Acl $target -whatif
}

the above script doesnt copy ntfs permissions, not sure why.. any suggestions ?

thank you..
 
got the above script working, but it doesnt copy permissions at file level.. any suggestions please thank you
 
thank you 58sniper, i got the script working.. but it only copies permissions at folder and subfolder.. I have some permissions at file level this does not get copied.. would really appreciate any help..

thank you
 
hi ,

the problem was it worket well but it also inhereted the permissions.

how can I remove the inhereting permisisons in subfolders?

i found this script that will not get inhereted permisisons

(Get-Acl $Path).Access | ?{ !$_.IsInherited } | Select-Object `
@{n='Path';e={ $Path }}, IdentityReference, AccessControlType, `
InheritanceFlags, PropagationFlags, FileSystemRights

no sure how i can combine it with my script to stop inhereting permissions

thank you
ameyuk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top