rodkort
New member
Hi,
I have the following code which creates a directory and assigns certain permissions for users, which works fine:
Like I said the works fine for a user in a domain (e.g. userName = "DOMAIN\john.smith"), however if I try to run it for a domain group (e.g. userName = "DOMAIN\Authenticated Users") then it doesn't work. How can I create a folder while setting permissions for a group?
Cheers
Simon
I have the following code which creates a directory and assigns certain permissions for users, which works fine:
VB.NET:
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule(New FileSystemAccessRule(userName, FileSystemRights.Modify, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow))
FolderAcl.SetAccessRuleProtection(True, False) 'uncomment to remove existing permissions
System.IO.Directory.CreateDirectory(folderName, FolderAcl)
Like I said the works fine for a user in a domain (e.g. userName = "DOMAIN\john.smith"), however if I try to run it for a domain group (e.g. userName = "DOMAIN\Authenticated Users") then it doesn't work. How can I create a folder while setting permissions for a group?
Cheers
Simon