How to limit rights on C drive for Authenticated Users
In some cases, it can be interesting to control the level of authorization that we leave to users on the C: drive.
With this in mind and to respond to certain customer requests, I made a PowerShell script to limit write rights for authenticated users using the icacls command.
The script is available on github : https://github.com/ChrisMogis/DriveC_RightsModification
Script details
Script execution
The script has two parts, the first allows you to delete user rights and the second part allows you to restore them.Command line to remove permissions:
- powershell.exe -ExecutionPolicy Bypass -file DriveC_RightsModification.ps1 -Param Remove
Command line to restore permissions:
- powershell.exe -ExecutionPolicy Bypass -file DriveC_RightsModification.ps1 -Param Add
Logs
A logs files is created depending on the action taken in the CCMTune directory on C:
- CCMTRemoveRightOnC.log for "Remove" action
- CCMTAddRightOnC.log for "Add" action
In this log file are stored the information below :