DSC: Error: Index operation failed; the array index evaluated to null (UserRightsAssignment): Unterschied zwischen den Versionen
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „right == Error == The following error occurs when you try to run ''Start-DscConfiguration -UseExisting -Wait -Verbose'':<br> '''In…“) |
Admin (Diskussion | Beiträge) K |
||
(Eine dazwischenliegende Version des gleichen Benutzers werden nicht angezeigt) | |||
Zeile 14: | Zeile 14: | ||
This module generates a temporary local security Policy (C:\Windows\TEMP\SecurityPolicy.inf). You can see this if you enable the DSC debug log: <br> | This module generates a temporary local security Policy (C:\Windows\TEMP\SecurityPolicy.inf). You can see this if you enable the DSC debug log: <br> | ||
[[Datei:02-event 4118.png]] | [[Datei:02-event 4118.png]] | ||
+ | |||
+ | ''Stupid is that DSC does not simply overwrite the temporary local security policy.'' | ||
Aktuelle Version vom 28. Januar 2022, 09:17 Uhr
Error
The following error occurs when you try to run Start-DscConfiguration -UseExisting -Wait -Verbose:
Index operation failed; the array index evaluated to null.
In the Windows Eventlog you can see a similar error, Event ID 4103 in Microsoft-Windows-Desired-State-Configuration/Operational:
This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on MSFT_UserRightsAssignment DSC resource. FullyQualifiedErrorId is NullArrayIndex. Error Message is Index operation failed; the array index evaluated to null..
Cause
This is maybe because your temporary local security policy is corrupt.
DSC uses the PowerShell Module "SecurityPolicyDsc" located at one of the Windows PowerShell module directories.
This module generates a temporary local security Policy (C:\Windows\TEMP\SecurityPolicy.inf). You can see this if you enable the DSC debug log:
Stupid is that DSC does not simply overwrite the temporary local security policy.
Solution
- Rename or delete the temporary local security policy (C:\Windows\TEMP\SecurityPolicy.inf).
- Run your DSC command again and it should work.