Open GerritH92 opened 2 years ago
I have seen this fail to apply when the account_lockout_duration is set to 0 in the configuration. If you update the dscresource module 'MSFT_AccountPolicy.psm1' to accept the range of values for this option to be (-1,99999) instead of (0,99999) for both the Set-TargetResource and Test-TargetResource functions. These are around lines 118 and 293 in the source.
Details of the scenario you tried and the problem that is occurring
We use below resource in our guest configuration package for vms on Azure. When running the Get-GuestConfigurationPackageComplianceStatus with our package we get the error as seen in attached screenshot. The error says i cannot convert the string -1 to an int. But nowhere on the machine or the .mof file of the configuration the -1 value is stated. This causes the guest configuration to show as non-compliant is azure.
Anyone able to debug this or running into the same problem?
Verbose logs showing the problem
Suggested solution to the issue
Please help!
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 2019 Datacenter OsOperatingSystemSKU : DatacenterServerEdition OsArchitecture : 64-bit WindowsVersion : 1809 WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434 OsLanguage : en-US OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
PSVersion 7.2.0 PSEdition Core GitCommitId 7.2.0 OS Microsoft Windows 10.0.17763 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
Version of the DSC module that was used
2.10.0