Closed JasonN3 closed 4 years ago
Tests run using a non-DA account:
Set-TargetResource -Ensure Present -ObjectType '00000000-0000-0000-0000-000000000000' -InheritedObjectType '00000000-0000-0000-0000-000000000000' -Path $ObjectDN -IdentityReference "${DOMAIN}\${ACCOUNT}" -ActiveDirectoryRights GenericAll -AccessControlType Allow -ActiveDirectorySecurityInheritance None
Set-TargetResource -Ensure Present -ObjectType '00000000-0000-0000-0000-000000000000' -InheritedObjectType '00000000-0000-0000-0000-000000000000' -Path $ObjectDN -IdentityReference "${DOMAIN}\${ACCOUNT}" -ActiveDirectoryRights GenericAll -AccessControlType Allow -ActiveDirectorySecurityInheritance None
$Update Permissions (Result = Access replaced) Set-TargetResource -Ensure Present -ObjectType '00000000-0000-0000-0000-000000000000' -InheritedObjectType '00000000-0000-0000-0000-000000000000' -Path $ObjectDN -IdentityReference "${DOMAIN}\${ACCOUNT}" -ActiveDirectoryRights GenericRead -AccessControlType Allow -ActiveDirectorySecurityInheritance None
Set-TargetResource -Ensure Absent -ObjectType '00000000-0000-0000-0000-000000000000' -InheritedObjectType '00000000-0000-0000-0000-000000000000' -Path $ObjectDN -IdentityReference "${DOMAIN}\${ACCOUNT}" -ActiveDirectoryRights GenericRead -AccessControlType Allow -ActiveDirectorySecurityInheritance None
Set-TargetResource -Ensure Absent -ObjectType '00000000-0000-0000-0000-000000000000' -InheritedObjectType '00000000-0000-0000-0000-000000000000' -Path $ObjectDN -IdentityReference "${DOMAIN}\${ACCOUNT}" -ActiveDirectoryRights GenericRead -AccessControlType Allow -ActiveDirectorySecurityInheritance None
This fix breaks down when you use Invoke-DscResource and it goes through WinRM. I'm looking for another solution.
Hi @J4yD4n, please look at the issue and complete the discussion on that before you end up spending your time on a PR that may not be needed.
Apparently DSC gets around Set-Acl trying to rewrite all permissions and failing. I did a test with PsDscCredential and it somehow worked even though it shouldn't have. Sorry for the waste of time. If someone else comes across this problem, make sure PsDscCredential is set.
Pull Request (PR) description
This pull request is to fix an issue where the DSC module must be run as a Domain Admin in order to update an objects permissions.
This Pull Request (PR) fixes the following issues
Task list
This change is