Relevance on Default User Hive

Hello, i would like to be able to apply a fix on computers that does not meet relevance expression based on default user hive.

Could someone tell me how to do?

Thank you

can you provide a lot more info, examples, screenshots, etc…?

Hello, on our Sysprep Windows 10 master image, we have made this change:

REG LOAD Hkey_local_machine.LoadDefUser “C:\Users\Default\NTUser.dat”
reg add “HKLM.LoadDefUser\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows” /v “LegacyDefaultPrinterMode” /t REG_DWORD /d “1” /f
reg add “HKLM.LoadDefUser\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows” /v “IsMRUEstablished” /t REG_DWORD /d “1” /f
reg add “HKLM.LoadDefUser\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows” /v “Device” /t REG_SZ /d “Microsoft Print to PDF,winspool,Ne01:” /f
REG UNLOAD Hkey_local_machine.LoadDefUser

This allow us to set a certain printer behaviour on every new profile created on the computer.

Now i would like to make this same change with Bigfix for computer that does not have this settings made on the default user hive. To accomplish that, I need a relavance that will be able to read the content of the default user hive and than apply a fix to this same default user hive…

Hope this is clear :slight_smile:
Thank you

The registry hive isn’t normally loaded, so you won’t be able to do it in Relevance directly - you’d instead need to set up a task where the actionscript can load the default user hive, then detect the settings, update them if needed, and then unload the hive again. Basically all the same stuff your existing script is doing.

Not pretty clean but this relevance seems to work by simply reading RAW data of the user file hive

exists file (“C:\Users\Default\NTuser.dat”) whose (not exists line whose (it contains “LegacyDefaultPrinterMode”) of it)

The better way to go about this would be to use Local GPO configured through BigFix to set this for All Users, regardless of if they are a new user or not.

The only exception to this may be if you want to configure defaults for new users, but not enforce them for existing users.

It looks like this example from @JasonWalker might be an option to do a one time config for all users, but not force it: https://www.bigfix.me/fixlet/details/3914

ActiveSetup is, in my opinion, one of the more useful and least-documented user experience items in Windows.

1 Like

I thought it was loaded under HKEY_USERS\.DEFAULT although I also vaguely recall some difference between DEFAULT and .DEFAULT so I might be off base here.

Try this:

not exists key "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion" whose (((value "LegacyDefaultPrinterMode" of it as integer) = 1) AND ((value "IsMRUEstablished" of it as integer) = 1) AND ((value "Device" of it as string) = "Microsoft Print to PDF,winspool,Ne01:")) of native registry

Defying expectations, HKEY_USERS\.Default is not used as the default for new user accounts; instead, this is HKCU for the LocalSystem account.

The default for new user accounts is the ntuser.dat file at C:\Users\Default, and is not loaded as a registry hive unless you mount it (for example via ‘reg.exe load’).

To apply settings for other user accounts, one could use an action to ‘reg load’ the hive and then update it via reg.exe (but Relevance for that would be challenging, one would probably have to coerce a check via a breadcrumb or client setting). Preferable would be to use LGPO for Local Group Policy, or ActiveSetup, or a logon/startup script.

1 Like