Hello,
I have discovered PSAD 4 months ago , AND I LOVE IT !
But I am still surprised there are 2 essential functions missing :
Copy-Folder : Copy a folder and its contents
Set-Security : Set/Add/Remove NTFS security attributes & rights on a file or on a folder (recursively/or not) , inheritance etc …
Is it planned ?
Best regards
The Copy-File function in the toolkit lets you copy a folder and it’s contents.
PowerShell has a built in cmdlet called Set-Acl that lets you modify security attributes on files and folders. It should be relatively easy to create your own function that uses the built in cmdlet and adds some logging around it. We don’t have any plans to create such a function.
Hello,
Thank you for your reply.
For Copy-File : I recommend changing the documentation then, because it it not specified that we can copy folders
For Set-Security : the idea was to be able to make a command more user-friendly, but no problem, you’re the boss
Thank you !
I’ll look at updating the documentation in the next release.
hampus
December 16, 2015, 11:18pm
5
For the NTFS security you can easily combine this script with the NTFSSecurity module. I think it’s both easier and have more functions then using Windows own modules. You can find more info on that script here,
https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85
For this function I have gotten the following to work (example from my java pkg)
Copy-File -Path “$dirFiles\Deployment*.*” -Destination “C:\Windows\Sun\Java\Deployment” -recurse
$Acl = Get-Acl “C:\Windows\Sun\Java\Deployment\exception.sites”
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("XXX\Domain Users", "FullControl", "Allow")
$Acl.SetAccessRule($Ar)
Set-Acl "C:\Windows\Sun\Java\Deployment\exception.sites" $Acl