Powershell

Icacls: The Ultimate Guide in Managing File Permissions

Icacls stands for “Integrity Control Access Control Lists”. It is a command-line tool that enables the users to view, manage, and modify permissions of the file and folder. Moreover, it includes some advanced features including “Inheritance”, “Ownership”, “Backup”, and “Restore”. It is designed to target IT professionals so they can manage permissions for thousands of files and folders.

In this article, the “icacls” cmdlet will be used to manage files and folder permissions.

What is the “Icacls” Cmdlet in PowerShell?

It is stated that the “icacls” is used to manage permissions of the file and folders. Check out the below-given examples for managing the permissions of files and folders.

Example 1: Use the “icacls” Cmdlet to Display the Permissions

Use the “icacls” cmdlet along with the file directory to get the permissions of a stated file:

icacls "C:\Docs\New.txt"

 

Example 2: Use the “icacls” Cmdlet to Display the Permissions for a Folder and its Subfolder

Rub the given command to output the permissions of the files/folders in the subdirectory:

icacls "C:\Docs" /T

 

Example 3: Use the “icacls” Cmdlet to Add a Permission to a File or Folder

To apply or add the permissions to a file or folder execute the given command:

icacls "C:\Docs\New.txt" /grant "Muhammad Farhan:(CI)(OI)F"

 

Example 4: Use the “icacls” Cmdlet to Remove Permissions From a File or Folder

To remove the permissions of a file or folder, use the provided code:

icacls "C:\Docs\New.txt" /remove "Muhammad Farhan"

 

Example 5: Use the “icacls” Cmdlet to Deny Permissions to a File or Folder

In order to deny the permissions of a specific file or folder, execute the given command:

icacls "C:\Docs\New.txt" /deny "Muhammad Farhan:(CI)(OI)F"

 

That was all about the “icacls” cmdlet.

Conclusion

The “icacls” cmdlet is used to manage file or folder permissions including removing, adding, denying, or displaying in PowerShell. Moreover, it can manage the permissions of various files and folders at once. This post has elaborated on the “icacls” cmdlet with the assistance of several examples.

About the author

Muhammad Farhan

I am a Computer Science graduate and now a technical writer who loves to provide the easiest solutions to the most difficult problems related to Windows, Linux, and Web designing. My love for Computer Science emerges every day because of its ease in our everyday life.