Separate backgrounds for Admin and User accounts

rusty

New Member
I am trying to set up Win 11 with an admin and user accounts. I want to know if there is a way to set it with a background image for the admin and a separate background image for the user. I am wanting it automated in the ISO so that when I deploy it they are already set as the backgrounds for each. I do know how to change and set the background by changing img0.jpg but I can only make on that shows on both. I am wanting them to be different. is this possible?
 
The better answer is to replace the default Windows wallpaper for everyone, and separately update the Administrator's NTUSER.DAT.

Solution 1:
Replace the wallpaper for a single Administrator, when the username is known.

Run these commands in Post-Setup (Machine), or wrap them inside a batch file.
Code:
reg load HKU\Admin C:\Users\Administrator\NTUSER.DAT
reg add "HKEY_USERS\Admin\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Theme1\img13.jpg" /f
reg unload HKU\Admin

Solution 2:
Replace the wallpaper for everyone in Administrators group, using a PowerShell script.
Run this script in Post-Setup (Machine), with no parameters.

Set-WallPaper.ps1
Code:
$File = $args[0]

if ($File -eq $null -or -not (Test-Path $File)) {
    exit
}

$AdminGroup = (Get-LocalGroupMember -Group Administrators).Name | Split-Path -Leaf

foreach ($User in $AdminGroup) {
    try {
        $Result = reg load HKLM\TEMP "C:\Users\$User\NTUSER.DAT"
        if ($LASTEXITCODE -ne 0) { throw $Output }

        Set-ItemProperty -Path 'HKLM:\TEMP\Control Panel\Desktop' -Name WallPaper -Value $File
        reg unload HKLM\TEMP
    }
    catch {
        continue
    }
}
 
Solution one is not working for me. I am sure that I am entering something wrong. I do have 2 admin and one user account so I figured that I should run the script anyway to cover both admin accounts. the only problem is that I have no idea how to do that. I am very new to ntlite. I know how to add cmds in the post set up but have no clue about adding scripts. any chance when you get time could you let me know? Also is it possible to move a file from c drive to the desktop before first login
 
Why not use the PS script? Copy it to a file with the correct .ps1 extension. Now add this as a File, and NTLite will do the right thing.

The trick is each user has a separate NTUSER.DAT, and you have to load them one at a time for editing.
 
one last thing. in the ps1 script. am I supposed to change anything to get the correct image that I want to use? I have tried all of these from changing the path that you gave me in the reg to my path and even making the same path that you gave me. when I run the three reg commands pls the ps1 file the system crashes after restarting. is there an order that they need to be in if they all three run together? I am learning a ton and really appreciate you help
 
Oh sorry, I forget the PS script expects a filename argument. My bad.

Try this version instead. Then you don't need to struggle with argument passing.
Code:
$AdminGroup = (Get-LocalGroupMember -Group Administrators).Name | Split-Path -Leaf

foreach ($User in $AdminGroup) {
    try {
        $Result = reg load HKLM\TEMP "C:\Users\$User\NTUSER.DAT"
        if ($LASTEXITCODE -ne 0) { throw $Output }

        Set-ItemProperty -Path 'HKLM:\TEMP\Control Panel\Desktop' -Name WallPaper -Value "C:\Windows\Web\Wallpaper\Theme1\img13.jpg"
        reg unload HKLM\TEMP
    }
    catch {
        continue
    }
}
 
Back
Top