Open a PowerShell console with Admin rights.
Install the PowerShell NTFS Security module from the PowerShell Gallery as per
here.
EDIT: If you want to mark the PowerShell Gallery as a Trusted repository, (it's run by Microsoft), open a PoSh console as Admin and enter the following:
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
PoSh will no longer complain about modules installed from it being non-signed.
Set2Rights.ps1
$source = 'C:\Employees'
get-childitem -Path $source -Directory -Name | % { Add-NTFSAccess -Path "$source\$_" -Account "$env:computername\$_" -AccessRights FullControl }
If you don't want them to have full control of their directory, change
FullControl to any of the following, multiple terms to be comma separated:
AppendData, ChangePermissions, CreateDirectories, CreateFiles, Delete, DeleteSubdirectoriesAndFiles, ExecuteFile, FullControl, GenericAll, GenericExecute, GenericRead, GenericWrite, ListDirectory, Modify, None, Read, ReadAndExecute, ReadAttributes, ReadData, ReadExtendedAttributes, ReadPermissions, Synchronize, TakeOwnership, Traverse, Write, WriteAttributes, WriteExtendedAttributes
NOTE: OK, I got un-lazy and tested it, couple of typos but it worked.
You'll need to create a shortcut and add options to bypass Policy Control, set the following as
Target, (change path to file to suit), and set the
Run as admin option, (under
Advanced).
powershell.exe -executionpolicy bypass -File "<full path>\Set2Rights.ps1"
Or if running from a CLI/PoSh, (as Admin):
powershell.exe -executionpolicy bypass -File "<full path>\Set2Rights.ps1"