cNtfsAccessControl DSC Resource

Welcome Forums DSC (Desired State Configuration) cNtfsAccessControl DSC Resource

Viewing 2 reply threads
  • Author
    Posts
    • #235138
      Participant
      Topics: 12
      Replies: 14
      Points: 144
      Rank: Participant

      Hi,

      I’ve been using this module to set permissions on a set of folders that I need to create and it all works well. 

      My question is, if I add a permission outside of DSC, how can I make sure that DSC will remove that permission when I re-apply the configuration? 

      Thanks

      `# Setup Permissions</div>
      cNtfsPermissionEntry ‘datashare0’ {</div>
      Ensure = ‘Present'</div>
      DependsOn = “[File]MainDirectory”</div>
      Principal = ‘Authenticated Users'</div>
      Path = ‘C:\MainData'</div>
      AccessControlInformation = @(</div>
      cNtfsAccessControlInformation</div>
      AccessControlType = ‘Allow'</div>
      FileSystemRights = ‘Read'</div>
      Inheritance = ‘ThisFolderSubfoldersAndFiles'</div>
      NoPropagateInherit = $false</div>
      }`
    • #235252
      Senior Moderator
      Topics: 9
      Replies: 1244
      Points: 4,480
      Helping Hand
      Rank: Community Hero

      Set your configuration mode to ApplyAndAutoCorrect, it will check the consistency based on the ConfigurationModeFrequencyMins set.

      btwn: You can format you code reading the instructions in the pinned page of the forums
      https://powershell.org/forums/topic/read-me-before-posting-youll-be-glad-you-did/

    • #235399
      Participant
      Topics: 12
      Replies: 14
      Points: 144
      Rank: Participant

      Hi,

      Thanks, I’ll try that tonight.

      Regards

      Nick

       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.