Details of the scenario you tried and the problem that is occurring
A resource conflict occurs when trying to remove and add Identities in the same configuration
Verbose logs showing the problem
Test-ConflictingResources : A conflict was detected between resources '[UserRightsAssignment]LogOnAsService
(C:\Users\Administrator\Documents\TestLogonAsService.ps1::7::9::UserRightsAssignment)' and '[UserRightsAssignment]LogOnAsService1
(C:\Users\Administrator\Documents\TestLogonAsService.ps1::14::9::UserRightsAssignment)' in node 'localhost'. Resources have identical key properties but there are differences in
the following non-key properties: 'Ensure;Identity'. Values 'Present;User1' don't match values 'Absent;User2'. Please update these property values so that they are identical in
both cases.
Suggested solution to the issue
Make Identity a Key property along with Policy
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Details of the scenario you tried and the problem that is occurring
A resource conflict occurs when trying to remove and add Identities in the same configuration
Verbose logs showing the problem
Test-ConflictingResources : A conflict was detected between resources '[UserRightsAssignment]LogOnAsService (C:\Users\Administrator\Documents\TestLogonAsService.ps1::7::9::UserRightsAssignment)' and '[UserRightsAssignment]LogOnAsService1 (C:\Users\Administrator\Documents\TestLogonAsService.ps1::14::9::UserRightsAssignment)' in node 'localhost'. Resources have identical key properties but there are differences in the following non-key properties: 'Ensure;Identity'. Values 'Present;User1' don't match values 'Absent;User2'. Please update these property values so that they are identical in both cases.
Suggested solution to the issue
Make Identity a Key property along with Policy
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows Server 2012 R2 Standard OsOperatingSystemSKU : StandardServerEdition OsArchitecture : 64-bit WindowsBuildLabEx : 9600.18505.amd64fre.winblue_ltsb.160930-0600 OsLanguage : en-US OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
5.1
Version of the DSC module that was used ('dev' if using current dev branch)
2.8.0.0