SidAclReplacer

1.0.0

NTFS ACL SID 管理工具 — 在文件/目录的 DACL 中替换或移除 SID,完整保留 ACE 类型、权限掩码、继承标志和规范顺序。提供 Update-AclSid(替换)和 Remove-AclSid(移除)两个命令。

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name SidAclReplacer

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name SidAclReplacer

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 SidAclReplacer. All rights reserved.

Package Details

Author(s)

  • SidAclReplacer

Tags

NTFS ACL SID Security Permissions Migration AccessControl Windows FileSystem

Cmdlets

Update-AclSid Remove-AclSid

Functions

Update-AclSid Remove-AclSid

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

v1.0.0

SidAclReplacer — NTFS ACL SID 管理工具

功能:
 - Update-AclSid: 将 ACL 中匹配的 SID 替换为新 SID,保留 ACE 完整结构
 - Remove-AclSid: 移除 ACL 中指定 SID 的所有权限记录,支持孤立 SID 清理

Update-AclSid 特性:
 - 支持 DACL / SACL / Owner / Group 替换
 - 使用 RawSecurityDescriptor 低层 API 原地替换,不破坏 ACE 规范顺序
 - 递归处理目录树,流式输出结果
 - WhatIf / Confirm 安全模式

Remove-AclSid 特性:
 - 按 -TargetSid 移除特定 SID 的权限记录
 - 按 -AllUnknownSid 清理所有无法解析的孤立 SID
 - 按 -AccessControlType 过滤 Allow / Deny 类型
 - 不处理 Owner/Group,专注 DACL 清理

技术栈:
 - C# 二进制 PowerShell 模块(netstandard2.0,兼容 PS 5.1 和 PS 7+)
 - 纯 PowerShell 脚本回退实现(零依赖)
 - 双实现自动切换,DLL 加载失败时无缝回退

FileList

  • SidAclReplacer.nuspec
  • SidAclReplacer.dll
  • SidAclReplacer.psd1
  • SidAclReplacer.psm1
  • System.Buffers.dll
  • System.IO.FileSystem.AccessControl.dll
  • System.Memory.dll
  • System.Numerics.Vectors.dll
  • System.Runtime.CompilerServices.Unsafe.dll
  • System.Security.AccessControl.dll
  • System.Security.Principal.Windows.dll
  • Update-AclSid.ps1

Version History

Version Downloads Last updated
1.0.0 (current version) 5 10/7/2026