-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore permissions does not seem to work #25
Comments
Hi,
If I need to save/restore rights, it is better to save as xml, with export/import-clixml.
Actually doing that, you do not really need NTFSSecurity module.
Example:
To save them:
Get-item \\uni.au.dk\alt\ST_LaheyFortranLicens | get-acl | Export-Clixml .\output\ST_LaheyFortranLicens.xml
To add them:
Import-Clixml .\output\ST_LaheyFortranLicens.xml | Set-Acl -Path <path>
I know it does not solve your current problem with csv, but this is neater ;)
Med venlig hilsen / Best regards
Johan Cardel
Storage admin
Fra: Dirk Hondong [mailto:[email protected]]
Sendt: 16. november 2017 12:40
Til: raandree/NTFSSecurity <[email protected]>
Cc: Subscribed <[email protected]>
Emne: [raandree/NTFSSecurity] Restore permissions does not seem to work (#25)
Hi Raimund,
I try to backup and restore NTFS permission but it seems that it does not work properly.
I took your example:
#to backup permissions just pipe what Get-NTFSAccess returns to Export-Csv
dir | Get-NTFSAccess -ExcludeInherited | Export-Csv permissions.csv
#to retore the permissions pipe the imported data to Get-NTFSAccess
#As the imported data also contains the path you do not need to specify the item
Import-Csv .\permissions.csv | Get-NTFSAccess
1st, I have created a backup but modified the dir command a bit:
dir -Recurse -directory | Get-NTFSAccess -ExcludeInherited | Export-CSV ....
The csv looks fine.
Now the following: I have removed a user group "G-Whatever" from a folder and ran the "resttore command"
The thing is: the removed group does not appear, it is still missing.
I have no clue why this is happening.
Since I have to adjust a few more NTFS rights it would be great if I can restore the oridinal NTFS rights if something goes wrong.
Or different idea: getting a backup, copy the csv, edit the copy and adjust the information there to set new permissions afterwards (this was Jan-Hendriks idea).
Regards
Dirk
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#25>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AVAoW3JzqcyKHZbSszB8cgO_JjdZbet1ks5s3B78gaJpZM4QgXAA>.
|
Additional note: if I run add-NTFSAccess -Path -Account -AccessRights it works fine. |
Hi @jcardel |
@DiHo78, sorry for the late reply. I have had lost track on this project. I have just tested this procedure and it works just fine:
|
Hi! CSV File content:
|
that's exactly what I'm batteling wiht at the moment :-( |
Not the most elegant way but this should solve it: Get-NTFSAccess -Path D:\ | ForEach-Object { $_ | Add-Member -Name AppliesTo -MemberType NoteProperty -Value ([Security2.FileSystemSecurity2]::ConvertToApplyTo($_.InheritanceFlags, $_.PropagationFlags)) -PassThru } | Export-Csv d:\p.csv
|
Hi Raimund,
I try to backup and restore NTFS permission but it seems that it does not work properly.
I took your example:
#to backup permissions just pipe what Get-NTFSAccess returns to Export-Csv
dir | Get-NTFSAccess -ExcludeInherited | Export-Csv permissions.csv
#to retore the permissions pipe the imported data to Get-NTFSAccess
#As the imported data also contains the path you do not need to specify the item
Import-Csv .\permissions.csv | Get-NTFSAccess
1st, I have created a backup but modified the dir command a bit:
dir -Recurse -directory | Get-NTFSAccess -ExcludeInherited | Export-CSV ....
The csv looks fine.
Now the following: I have removed a user group "G-Whatever" from a folder and ran the "resttore command"
The thing is: the removed group does not appear, it is still missing.
I have no clue why this is happening.
Since I have to adjust a few more NTFS rights it would be great if I can restore the oridinal NTFS rights if something goes wrong.
Or different idea: getting a backup, copy the csv, edit the copy and adjust the information there to set new permissions afterwards (this was Jan-Hendriks idea).
Regards
Dirk
The text was updated successfully, but these errors were encountered: