With the Registry resource, you cannot configure the same registry key for different users, at the same time, with the same configuration. Take a look at the following example.
Details of the scenario you tried and the problem that is occurring
Test-ConflictingResources : A conflict was detected between resources '[Registry]Run_user1
(C:\RegistryExample.ps1::15::9::Registry)' and '[Registry]Run_user2
(C:\RegistryExample.ps1::23::9::Registry)' in node 'localhost'. Resources have identical key properties but there are differences in the following
non-key properties: 'PsDscRunAsCredential'. Values 'System.Management.Automation.PSCredential' don't match values 'System.Management.Automation.PSCredential'. Please update these property values so that they
are identical in both cases.
At line:289 char:9
+ Test-ConflictingResources $keywordName $canonicalizedValue $k ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], InvalidOperationException
+ FullyQualifiedErrorId : ConflictingDuplicateResource,Test-ConflictingResources
Compilation errors occurred while processing configuration 'RegistryExample'. Please review the errors reported in error stream and modify your configuration code appropriately.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3917 char:5
+ throw $ErrorRecord
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (RegistryExample:String) [], InvalidOperationException
+ FullyQualifiedErrorId : FailToProcessConfiguration
Suggested solution to the issue
I don't know if there is any reasonable way out of this situation. What comes to mind is adding a new DSC property, marked as a key, but optional. This property would not be used in the implementation of the resource, but it would give the possibility of additional identification of this resource, well, and would allow to solve this conflict. For example, a configuration with this key could look like the following.
Hello,
With the
Registry
resource, you cannot configure the same registry key for different users, at the same time, with the same configuration. Take a look at the following example.Details of the scenario you tried and the problem that is occurring
Verbose logs showing the problem
Suggested solution to the issue
I don't know if there is any reasonable way out of this situation. What comes to mind is adding a new DSC property, marked as a key, but optional. This property would not be used in the implementation of the resource, but it would give the possibility of additional identification of this resource, well, and would allow to solve this conflict. For example, a configuration with this key could look like the following.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
2.12.0.0