Set File Permission (NTFS) using PowerShell DSC

Welcome Forums DSC (Desired State Configuration) Set File Permission (NTFS) using PowerShell DSC

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 8 months ago.

  • Author
  • #48670

    Points: 0
    Rank: Member

    Hi everyone,

    I've used a sample NTFSPermission PS DSC script to manage file sharing. When I used it to Deny users to access a file, it works, but when I reuse the script again to try to revert it (giving back the access), it won't work. Why is that?

    Here's the code:

      configuration SetNTFSPermission
            # Target nodes to apply the configuration
            [string[]]$NodeName = 'localhost',
            # Add Account
              # Create a Physical Path
            # Add Access
             # Add Rights
    # Import the module that defines custom resources
        Import-DscResource -Module xPSDesiredStateConfiguration
        Node $NodeName
           NTFSPermission NewPermission
                Ensure = "Present"
                Account = $Account
                Access = $Access
                Path = $PhysicalPath
                Rights = $Rights
    Start-DscConfiguration -Force -Wait -Verbose -Path .\SetNTFSPermission
  • #48804

    Points: -19
    Rank: Member

    I might have missed something but xPSDesiredStateConfiguration has no builtin-resource that deals with NTFSPermissions.

    Are you using a 3rd party DSC resource ?

    Are you using the latest stable version of it, is it sill maintained ?

    Make sure you have the Import command for that module and that its available on the node you want it applied, unless you're using a Pull Server then make sure the module is on the pull server location.

    I suspect you'll need to ask the creator of this module or add the module name and where you got it from so we might
    look into it.

The topic ‘Set File Permission (NTFS) using PowerShell DSC’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort