You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
Using DSC to deploy certificates to machines (GPO was exported and converted to DSC module using 'Baseline' PowerShell module) resulted in the log files ~1.5GB in size being generated over repeated refresh/application of the configuration which in turn filled the machine's operating system drive.
Verbose logs showing the problem
Microsoft support case 2105160060000454 would hold the issue re-created by the Microsoft engineer
Suggested solution to the issue
After repeated testing and research, I finally found the cause of the problem:
From the script of the DSC module:
C:\Program Files\WindowsPowerShell\Modules\GPRegistryPolicyDsc\1.2.0\Modules\GPRegistryPolicyFileParser\GPRegistryPolicyFileParser.ps1
The group policy file will save as a string value of a binary:
C:\Windows\System32\GroupPolicy\Machine\registry.pol
When policy apply second time, it will check the value from the policy file. However, it will read the value as binary directly and not convert it to string
Then it will compare it with the DSC configuration file, which the value is string. Thus, it will eventually write the output of the whole binary data, each byte will written in one line.
To resolve the issue please change the file GPRegistryPolicyFileParser.ps1:
From line 119:
[System.Byte[]] $value = $policyContentInBytes[($index)..($index + $valueLength - 1)]
Please change it to:
[System.String] $value = [System.Text.Encoding]::UNICODE.GetString($policyContents[($index)..($index + $valueLength - 1)])
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
I can't include most of the code, but the relevant section is below using module 'GPRegistryPolicyDsc'
Deploying multiple certificates causes increased memory consumption by the WmiPrvSE.exe process which, in turn, causes the System.OutOfMemoryException error to be thrown. The above solution also eliminates this problem.
Details of the scenario you tried and the problem that is occurring
Using DSC to deploy certificates to machines (GPO was exported and converted to DSC module using 'Baseline' PowerShell module) resulted in the log files ~1.5GB in size being generated over repeated refresh/application of the configuration which in turn filled the machine's operating system drive.
Verbose logs showing the problem
Microsoft support case 2105160060000454 would hold the issue re-created by the Microsoft engineer
Suggested solution to the issue
After repeated testing and research, I finally found the cause of the problem:
From the script of the DSC module:
C:\Program Files\WindowsPowerShell\Modules\GPRegistryPolicyDsc\1.2.0\Modules\GPRegistryPolicyFileParser\GPRegistryPolicyFileParser.ps1
The group policy file will save as a string value of a binary:
C:\Windows\System32\GroupPolicy\Machine\registry.pol
When policy apply second time, it will check the value from the policy file. However, it will read the value as binary directly and not convert it to string
Then it will compare it with the DSC configuration file, which the value is string. Thus, it will eventually write the output of the whole binary data, each byte will written in one line.
To resolve the issue please change the file GPRegistryPolicyFileParser.ps1:
From line 119:
[System.Byte[]] $value = $policyContentInBytes[($index)..($index + $valueLength - 1)]
Please change it to:
[System.String] $value = [System.Text.Encoding]::UNICODE.GetString($policyContents[($index)..($index + $valueLength - 1)])
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
I can't include most of the code, but the relevant section is below using module 'GPRegistryPolicyDsc'
The operating system the target node is running
OsName : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
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 5.1.17763.1007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used
Name Version Path
GPRegistryPolicyDsc 1.2.0 C:\Program Files\WindowsPowerShell\Modules\GPRegistryPolicyDsc\1.2.0\GPRegistryPolicyDsc.psd1
The text was updated successfully, but these errors were encountered: