This project has moved. For the latest updates, please go here.
1

Resolved

Escape needed for @ in Reg + Installer Detection Default

description

Wonderful tool!

I'm using Reg2CI Version 0.7.0.7. Windows 10 CB (1607) x64, ConfigMgr CB 1606 + w/o Hotfix.

Three small issues.
  1. There might be a need for another escape @ symbols in registry keys.
  2. It seems to automatically set a Windows Installer detection requirement for GUID {AC76BA86-7AD7-1033-7B44-AC0F074E4100}.
  3. The Home page here on CodePlex isn't showing the release notes for 0.7.0.7. It shows for 0.7.0.6 :)

Issue 1

Registry Key import used.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities]
"C@tsSmell"=dword:00000004

Command Line run to create imported cab file.
REG2CI.exe ValidCommunities_Bug.reg ValidCommunities_Bug.cab ValidCommunities_Registry_Bug
Resulting Detection Script
#Reg2CI (c) 2016 by Roger Zander
$bResult = $true;
if((Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities' -Name C@tsSmell -ea SilentlyContinue).C@tsSmell -eq 0x4) {  } else { $bResult = $false };
$bResult
Resulting Remediation Script
#Reg2CI (c) 2016 by Roger Zander
New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -ea SilentlyContinue;
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities' -Name C@tsSmell -Value 0x4 -PropertyType DWord -Force -ea SilentlyContinue;
ConfigMgr control panel \ report will show a Settings Discovery Error: 0x80070001, Incorrect Function.

If you escape with single quotes in both places in the Detection, and the only place in the remediation, all works as expected.

Modified Detection Script
#Reg2CI (c) 2016 by Roger Zander
$bResult = $true;
if((Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities' -Name 'C@tsSmell' -ea SilentlyContinue).'C@tsSmell' -eq 0x4) {  } else { $bResult = $false };
$bResult
Modified Remediation Script
#Reg2CI (c) 2016 by Roger Zander
New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -ea SilentlyContinue;
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities' -Name 'C@tsSmell' -Value 0x4 -PropertyType DWord -Force -ea SilentlyContinue;

Issue 2

If you see attached picture 6, it shows that there is a required detection string of GUID: {AC76BA86-7AD7-1033-7B44-AC0F074E4100}. Not sure where that came from!

file attachments

comments

rzander wrote Sep 6, 2016 at 8:01 PM

Thx for providing feedback... Will implement a Fix for Issue1. Issue2 is because I used AdobeReader as Template , so the GUID is historically... Will try to change that to use a PowerShell as detection script...

Regards

Roger

rzander wrote Sep 7, 2016 at 4:28 PM

Fixed in Changeset 44028 ( https://reg2ci.codeplex.com/SourceControl/changeset/44028 ) .
Change will be part of V0.7.0.8