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?Code: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)
Cheers
Simon


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks