2

The following DSC declaration writes to Registry key HKEY_USERS.DEFAULT\Console instead of HKEY_CURRENT_USER\Console. Why?

Registry ConsoleFaceName
{
  Key         = 'HKEY_CURRENT_USER\Console'
  ValueName   = "FaceName"
  ValueData   = "Lucida Console"
  Ensure      = "Present"
}
ChiliYago
  • 11,341
  • 23
  • 79
  • 126

1 Answers1

5

The behavior of writing to .DEFAULT is because the DSC Local Configuration Manager (LCM) is running as local system, which does not have a current user registry hive.

If you want it to update a particular user you need to run using PsDscRunAsCredential (docs linked), where $Credential is the credentials from the user you want to change the value for.

Registry ConsoleFaceName
{
  Key                   = 'HKEY_CURRENT_USER\Console'
  ValueName             = "FaceName"
  ValueData             = "Lucida Console"
  Ensure                = "Present"
  PsDscRunAsCredential  = $Credential
}

Before doing this please read Securing the MOF File.

TravisEz13
  • 2,263
  • 1
  • 20
  • 28