-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Sample config:
Configuration TestAppPackagePerms
{
Import-DscResource -ModuleName "cNtfsAccessControl"
Import-DscResource -ModuleName "PSDesiredStateConfiguration"
File CreateTestFolder
{
Type = "Directory"
DestinationPath = "C:\Program Files\Test"
Ensure = "Present"
}
cNtfsPermissionsInheritance DisableInheritOnProgramFilesTest
{
Path = "C:\Program Files\Test"
Enabled = $false
PreserveInherited = $false
DependsOn = "[File]CreateTestFolder"
}
cNtfsPermissionEntry SetPermsOnCTestForApplicationPackageAuthority
{
Ensure = "Present"
Path = "C:\Program Files\Test"
# For Principal, same results using the following:
# "ALL APPLICATION PACKAGES"
# "S-1-15-2-1"
Principal = "APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES"
AccessControlInformation = @(
cNtfsAccessControlInformation
{
AccessControlType = "Allow"
FileSystemRights = "ReadAndExecute"
Inheritance = "ThisFolderSubfoldersAndFiles"
}
)
DependsOn = "[cNtfsPermissionsInheritance]DisableInheritOnProgramFilesTest"
}
}
TestAppPackagePerms -Verbose
Start-DscConfiguration -Path .\TestAppPackagePerms -Wait -Verbose -ForceResult:
VERBOSE: [SERVER]: LCM: [ Start Resource ] [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority]
VERBOSE: [SERVER]: LCM: [ Start Test ] [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority]
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] Ensure : 'Present'
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] Path : 'C:\Program Files\Test'
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] Principal : 'APPLICATION PACKAGE AU
THORITY\ALL APPLICATION PACKAGES'
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] AccessControlInformation : 'cNtfsAccessControlInfo
rmation'
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] Verbose : 'True'
VERBOSE: [SERVER]: [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] Resolving identity reference 'APPLICATION PACKAGE
AUTHORITY\ALL APPLICATION PACKAGES'.
VERBOSE: [SERVER]: LCM: [ End Test ] [[cNtfsPermissionEntry]SetPermsOnCTestForApplicationPackageAuthority] in 0.0780 seconds.
PowerShell DSC resource cNtfsPermissionEntry failed to execute Test-TargetResource functionality with error message: The running command stopped because the preference
variable "ErrorActionPreference" or common parameter is set to Stop: Could not resolve identity reference 'APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES':
'Exception calling "Translate" with "1" argument(s): "Some or all identity references could not be translated."'.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
VERBOSE: [SERVER]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.8 seconds
`
Metadata
Metadata
Assignees
Labels
No labels