Adding permissions with Set-Acl in Powershell removes all inherited permissions on shares

I have no idea what’s going on here but when I try to add a permission using Set-Acl on a share where the share itself has inherited permissions, all inherited permissions are removed. Consider the following setup:

Physical Path                Shared as
C:File SystemTopFolder     \ServerTopFolder

If I add permissions on C:File System with inheritance and propagation, those permissions show up on the share \ServerTopFolder. This is expected. If I use Get-Acl and Set-Acl to add Access Rules to \ServerTopFolder then all inherited permissions on that share are removed. Here’s an example:

PS C:Usersadministrator> $FileSystemAcl = Get-Acl -Path "C:File System"

PS C:Usersadministrator> $FileSystemAcl.Access | Select-Object IdentityReference,FileSystemRights,IsInherited

IdentityReference                 FileSystemRights IsInherited
-----------------                 ---------------- -----------
NT AUTHORITYSYSTEM                    FullControl        True
BUILTINAdministrators                 FullControl        True
BUILTINUsers          ReadAndExecute, Synchronize        True
BUILTINUsers                           AppendData        True
BUILTINUsers                          CreateFiles        True
CREATOR OWNER                            268435456        True



PS C:Usersadministrator> $ShareAcl = Get-Acl -Path "\ServerTopFolder"

PS C:Usersadministrator> $ShareAcl.Access | Select-Object IdentityReference,FileSystemRights,IsInherited

IdentityReference                   FileSystemRights IsInherited
-----------------                   ---------------- -----------
DOMAINDomain Admins                     FullControl       False
DOMAINIT Services                       FullControl       False
NT AUTHORITYSYSTEM                      FullControl        True
BUILTINAdministrators                   FullControl        True
BUILTINUsers            ReadAndExecute, Synchronize        True
BUILTINUsers                             AppendData        True
BUILTINUsers                            CreateFiles        True
CREATOR OWNER                              268435456        True


PS C:Usersadministrator> $Permission = "DOMAINAdministrator",
        [System.Security.AccessControl.FileSystemRights]$("Modify", "Synchronize"),
        [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit",
        [System.Security.AccessControl.PropagationFlags]"None",
        [System.Security.AccessControl.AccessControlType]"Allow"
        $AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($Permission)

PS C:Usersadministrator> $ShareAcl.SetAccessRule($AccessRule)

PS C:Usersadministrator> Set-Acl -Path "\ServerTopFolder" -AclObject $ShareAcl

PS C:Usersadministrator> $ShareAcl = Get-Acl -Path "\ServerTopFolder"

PS C:Usersadministrator> $ShareAcl.Access | Select-Object IdentityReference,FileSystemRights,IsInherited

IdentityReference           FileSystemRights IsInherited
-----------------           ---------------- -----------
DOMAINadministrator     Modify, Synchronize       False
DOMAINDomain Admins             FullControl       False
DOMAINIT Services               FullControl       False

As you can see, the explicit permissions remain but all inherited permissions are removed. I’ve confirmed that this only happens when you run Set-Acl on the share itself. I’ve also tried to use $ShareAcl.SetAccessRuleProtection($false,$true) to make sure it’s not the handling of existing permissions that is the issue. For any subfolder or file that is not directly shared, this is not an issue. What is the reason for this and is there any way I can circumvent this behaviour?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật