我遇到一个小问题,将用户添加到文件夹权限,相关帐户是SCCM帐户“Interactive”,在部署应用程序时使用该帐户。
除了添加系统帐户(使用SID的经过身份验证的用户)以及从父级继承权限之外,我已经查看并找不到任何内容。
非常感谢任何示例的帮助。
AntonSK
------ *修改* ------
Code I我到目前为止,我遇到的问题是我不知道如何将其指定为来自域的OS insead的内置帐户。
Imports System.Security.AccessControl
Dim FolderPath As String = "C:\TestingFolder" 'Specify the folder here
Dim UserAccount As String = "*Local*\Interactive" 'Specify the user here (BuiltIn to Local Machine)
Dim FolderInfo As IO.DirectoryInfo = New IO.DirectoryInfo(FolderPath)
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.Modify, InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow))
'FolderAcl.SetAccessRuleProtection(True, False) 'uncomment to remove existing permissions
FolderInfo.SetAccessControl(FolderAcl)