Remove read permission in many groups

Zenith Works 20 Reputation points
2025-10-09T11:59:20.7933333+00:00

Hello every one

In our file server, we have too many folders and subfolders. Each folder and subfolder, have too many groups with write permission. How can we remove the write permission from all groups in every folder and subfolder (keeping only read permission)?

Thanks in advance.

Windows for business | Windows Server | Directory services | User logon and profiles
0 comments No comments
{count} votes

Answer accepted by question author
  1. Harry Phan 10,535 Reputation points Independent Advisor
    2025-10-09T12:01:32.59+00:00

    Hello Zenith, I strongly recommend taking a full backup or snapshot of the file server before making any changes. It's also wise to test the command on a small, non-critical set of folders first.

    The core command you would use looks like this, run from an elevated Command Prompt:

    icacls "D:\YourRootFolder\*" /inheritance:r /grant:r "Domain\Group1":(R) "Domain\Group2":(R)

    However, this basic example has a significant drawback: you must list every single group explicitly to grant them read permission. A more practical and safer approach is a two-step PowerShell script that:

    Removes all existing explicit permissions.

    Grants a specified set of groups read-only access.

    Given the complexity and risk, using a well-tested PowerShell script is the recommended method for a task of this scale. Would you like me to provide a sample script structure for this two-step process?

    Hope this points you in the right direction. If this answer is helpful, please feel free to mark it as accepted :)

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.