folder-permissions

Define where permissions apply with Set-Acl

怎甘沉沦 提交于 2020-01-16 00:33:25
问题 I'm trying to emulate in PowerShell what I typically do in the windows folder properties window available from: Folder properties → Secutity → Advanced → Permissions → Change Permissions... In that GUI there are tick boxes for Include inheritable permissions from this object's parent Replace all child object permissions with inheritable permissions from this object - I believe corresponds to PropagationFlag = None When you click the Add/Edit... button you have a drop down list with the

VB.NET app is setting restricted file permissions on a directory, which is incorrectly restricting user created files in the same directory

空扰寡人 提交于 2020-01-14 02:51:09
问题 My VB.NET application builds a tree of directories with restricted access. The access should be that a normal user can not delete or rename the existing tree. But the user can add new files/folders anywhere in the tree. A user created file/folder should be fully modifiable by any user. The problem I'm having is getting access set so that files/folders created by the app can't be changed, but files/folders created by users can be changed by any user. What is currently happening, is the files

Reading Share Permissions in C#

烂漫一生 提交于 2020-01-13 15:50:27
问题 Is it possible to read the sharing permissions assigned to a shared folder? I'm able to read in the local security settings programmaticaly (the ones found under Right Click > Properties > Security) no problem. But, I'm wondering how I can read the permissions under Right Click > Sharing and Security... > Permissions Here is an image of the Permissions I want to read: Is this possible? I'm running an XP Pro machine if it helps. Edit: As per my answer I was able to iterate through all the

Reading Share Permissions in C#

放肆的年华 提交于 2020-01-13 15:50:12
问题 Is it possible to read the sharing permissions assigned to a shared folder? I'm able to read in the local security settings programmaticaly (the ones found under Right Click > Properties > Security) no problem. But, I'm wondering how I can read the permissions under Right Click > Sharing and Security... > Permissions Here is an image of the Permissions I want to read: Is this possible? I'm running an XP Pro machine if it helps. Edit: As per my answer I was able to iterate through all the

How to give Folder Permission for IIS User in C#?

倾然丶 夕夏残阳落幕 提交于 2020-01-02 23:02:23
问题 I need to give Folder Permission for IIS User. Actually I wrote code like this.. public static void AddDirectorySecurity(string FileName, string Account, FileSystemRights Rights,AccessControlType ControlType) { DirectoryInfo dInfo = new DirectoryInfo(FileName); DirectorySecurity dSecurity = dInfo.GetAccessControl(); dSecurity.AddAccessRule( new System.Security.AccessControl.FileSystemAccessRule(objUser, Rights, ControlType)); dInfo.SetAccessControl(dSecurity); } I calling this above method

VB.NET app is setting restricted file permissions on a directory, which is incorrectly restricting user created files in the same directory

回眸只為那壹抹淺笑 提交于 2019-12-06 07:19:28
My VB.NET application builds a tree of directories with restricted access. The access should be that a normal user can not delete or rename the existing tree. But the user can add new files/folders anywhere in the tree. A user created file/folder should be fully modifiable by any user. The problem I'm having is getting access set so that files/folders created by the app can't be changed, but files/folders created by users can be changed by any user. What is currently happening, is the files/folders made by the application behave correctly. But when a user creates their own file/folder, that

Powershell script creating home folder for user and setting permissions

你离开我真会死。 提交于 2019-12-04 23:46:26
问题 I am doing a powershell script which creates new domain user accounts in AD, and also creating home directories in the file server with relevant permissions. My problem is I cannot get the permissions set. In the code below, my_fileServer is the file server name; sso means single-sign-on id, which in the test code below is set to "user9999". Any help is greatly appreciated! Set-Variable homeDir -option Constant -value "\\my_fileServer\Users" Set-Variable sso -option Constant -value "user9999"

Powershell script creating home folder for user and setting permissions

匆匆过客 提交于 2019-12-03 15:20:22
I am doing a powershell script which creates new domain user accounts in AD, and also creating home directories in the file server with relevant permissions. My problem is I cannot get the permissions set. In the code below, my_fileServer is the file server name; sso means single-sign-on id, which in the test code below is set to "user9999". Any help is greatly appreciated! Set-Variable homeDir -option Constant -value "\\my_fileServer\Users" Set-Variable sso -option Constant -value "user9999" # If the folder for the user does not exist, make a new one and set the correct permissions. if (