Forum Discussion

skybit9's avatar
skybit9
Copper Contributor
Apr 16, 2025

DSC SecurityPolicyDsc: "Could not infer CimType from the provided .NET object"

Hello Everyone,

I'm encountering a persistent issue while applying security baseline settings using the SecurityPolicyDsc module on Windows Server 2022. Despite providing valid settings (like Accounts_Limit_local_account_use_of_blank_passwords_to_console_logon_only = 'Enabled'), the DSC execution fails with the following error:

Could not infer CimType from the provided .NET object. The PowerShell DSC resource '[SecurityOption]LimitBlankPasswords' with SourceInfo '<file path>::SecurityOption' threw one or more non-terminating errors while running the Test-TargetResource functionality.

What I've done so far:
Verified the syntax and parameters using only one setting at a time
Downgraded SecurityPolicyDsc to 2.9.0.0 (as 2.10.0.0 has known CimType issues)
Confirmed MSFT_SecurityOption.schema.mof exists in the module directory
Ensured no null or invalid values are passed
Used explicit paths in Start-DscConfiguration
Ran under PowerShell 5.1 on Windows Server 2022 (Azure VM, domain-joined)

Despite all this, the error persists — even for a minimal configuration like:

Configuration SecurityTest { Import-DscResource -ModuleName 'SecurityPolicyDsc' Node 'localhost' { SecurityOption LimitBlankPasswords { Name = 'LimitBlankPasswords' Accounts_Limit_local_account_use_of_blank_passwords_to_console_logon_only = 'Enabled' } } } SecurityTest -OutputPath "C:\Temp\SecurityTest" Start-DscConfiguration -Path "C:\Temp\SecurityTest" -Wait -Verbose -Force

Any guidance or workarounds would be greatly appreciated. If there’s a known fix or update planned for SecurityPolicyDsc, I’d be happy to test that as well.


Thanks in advance!

No RepliesBe the first to reply

Resources