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
Hi Dave, I'm running into an issue when using PolicyFileEditor with DSC:
For eg, the script below works fine, sets the Group Policy as expected:
$UserDir = "$env:windir\system32\GroupPolicy\Machine\Registry.pol"
$RegPath = 'Software\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths'
$RegName = '\*\NETLOGON' # Backslash Backslash Asterisk Backslash NETLOGON
$RegData = 'RequireMutualAuthentication=1, RequireIntegrity=1, RequirePrivacy=1'
$RegType = 'String'
Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType
gpupdate
But not sure how to include "\*\NETLOGON" as ValueName for Key 'Software\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths' when using in DSC? I've tried it in few different ways, but couldn't get it working.
The text was updated successfully, but these errors were encountered:
techsnav
changed the title
How do I escape backslashes in keyname when using cAdministrativeTemplateSetting DSC resource?
How do I escape backslashes in keyValuename when using cAdministrativeTemplateSetting DSC resource?
Dec 24, 2020
Hi Dave, I'm running into an issue when using PolicyFileEditor with DSC:
For eg, the script below works fine, sets the Group Policy as expected:
$UserDir = "$env:windir\system32\GroupPolicy\Machine\Registry.pol"
$RegPath = 'Software\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths'
$RegName = '\*\NETLOGON' # Backslash Backslash Asterisk Backslash NETLOGON
$RegData = 'RequireMutualAuthentication=1, RequireIntegrity=1, RequirePrivacy=1'
$RegType = 'String'
Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType
gpupdate
But not sure how to include "\*\NETLOGON" as ValueName for Key 'Software\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths' when using in DSC? I've tried it in few different ways, but couldn't get it working.
cAdministrativeTemplateSetting 'Hardened UNC Paths NETLOGON'
{
KeyValueName = "Software\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths$([char]0x005C)$([char]0x005C)*$([char]0x005C)NETLOGON"
PolicyType = 'Machine'
Data = 'RequireMutualAuthentication=1, RequireIntegrity=1, RequirePrivacy=1'
Ensure = 'Present'
Type = 'String'
}
Appreciate your help!!!
The text was updated successfully, but these errors were encountered: