I am having a little problem, adding a user to a folders permission, the account in question is a SCCM account "Interactive" in which the account is used when deploying an application.
I have looked about and not found anything apart from adding a system account (Authenticated user using a SID) and to get the permissions to inherit from a parent.
Any help of examples would be greatly appreciated.
AntonSK
------ * Modified * ------
Code I have So far, the problem I also have is I do not know how to specify it as a built in account to the OS insead of from a domain.
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)