Windows 10: Setting lockscreen image for all users on a network after sysprep

Discus and support Setting lockscreen image for all users on a network after sysprep in Windows 10 Customization to solve the problem; Hi I used the sysprep tutorial to create an image for the classroom - during sysprep I created a users profile and locked all the personalization... Discussion in 'Windows 10 Customization' started by MikeNomad, Feb 20, 2017.

  1. MikeNomad Win User

    Setting lockscreen image for all users on a network after sysprep


    Hi I used the sysprep tutorial to create an image for the classroom - during sysprep I created a users profile and locked all the personalization settings - in the system group policy I set a default lock screen image and set to not allow changes to the lock screen - I used the copy profile for my answer file - windows 10 pro 1607 image

    This worked fine for the admin acount I created on initial setup however every new user account uses the slideshow and does not use the default image I setup - the image is stored in Windows/system32 folder

    I have tried editing the registry HKEY Local Machine -> Software -> Polices -> Microsoft -> Windows -> Personalization -> LockScreenImage

    to set the default image but this did not work.

    Is there any way of setting the default lock screen for all users on the machine to use the image I setup

    I also tried gpupdate /force I get the responce gpupdated but this does not fix the problem

    Any suggestions, software, regedits, powershell scrupts I can use to force all users to have the same lock screen

    thanks
    Mike

    :)
     
    MikeNomad, Feb 20, 2017
    #1
  2. jrng Win User

    "defaultuser0" created on clean install of Anniversary Update

    i also has the defaultuser0 in c:\users\. i am using the windows 10 1703 iso from VLSC and create golden image in VM and the golden image does not have defaultuser0 profile before i sysprep

    after sysprep, and deploy in TS and login, i see defaultuser0 in c:\users\
     
  3. Internet Explorer hangs running ActiveX scripting after sysprep

    This solution worked for me:

    • Don't use COPYPROFILE in unattend-XML answerfile

      Using COPYPROFILE causes the IE problem
    • Delete all user accounts except Administrator before sysprep

      Otherwise sysprep may fail with errors saying "... application xy installed but not provisioned for all users ..." if any appx-update comes in while you are working on the image
    After Startup and entering sysprep Audit-Mode,
    immediately go to local user management and check, if account Administrator
    is deactivated - if so, activate it.

    Richard
     
    RichardP63, Feb 20, 2017
    #3
  4. MikeNomad Win User

    Setting lockscreen image for all users on a network after sysprep

    Ok so after some searching I created the following PowerShell script to replace the default image for the login page - this works fine for a single user I thought by replacing the image in the Windows/web folder with my own any new users would have the same image but they get the standard image so I am stuck

    Code: $code = @" using System; using System.Runtime.InteropServices; namespace CosmosKey.Utils { public class TokenManipulator { [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen); [DllImport("kernel32.dll", ExactSpelling = true)] internal static extern IntPtr GetCurrentProcess(); [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); [DllImport("advapi32.dll", SetLastError = true)] internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); [StructLayout(LayoutKind.Sequential, Pack = 1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int Attr; } internal const int SE_PRIVILEGE_DISABLED = 0x00000000; internal const int SE_PRIVILEGE_ENABLED = 0x00000002; internal const int TOKEN_QUERY = 0x00000008; internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; public const string SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege"; public const string SE_AUDIT_NAME = "SeAuditPrivilege"; public const string SE_BACKUP_NAME = "SeBackupPrivilege"; public const string SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege"; public const string SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege"; public const string SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege"; public const string SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege"; public const string SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege"; public const string SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege"; public const string SE_DEBUG_NAME = "SeDebugPrivilege"; public const string SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege"; public const string SE_IMPERSONATE_NAME = "SeImpersonatePrivilege"; public const string SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege"; public const string SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege"; public const string SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege"; public const string SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege"; public const string SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege"; public const string SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege"; public const string SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege"; public const string SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege"; public const string SE_RELABEL_NAME = "SeRelabelPrivilege"; public const string SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege"; public const string SE_RESTORE_NAME = "SeRestorePrivilege"; public const string SE_SECURITY_NAME = "SeSecurityPrivilege"; public const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege"; public const string SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege"; public const string SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege"; public const string SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege"; public const string SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege"; public const string SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege"; public const string SE_TCB_NAME = "SeTcbPrivilege"; public const string SE_TIME_ZONE_NAME = "SeTimeZonePrivilege"; public const string SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege"; public const string SE_UNDOCK_NAME = "SeUndockPrivilege"; public const string SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege"; public static bool AddPrivilege(string privilege) { try { bool retVal; TokPriv1Luid tp; IntPtr hproc = GetCurrentProcess(); IntPtr htok = IntPtr.Zero; retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); tp.Count = 1; tp.Luid = 0; tp.Attr = SE_PRIVILEGE_ENABLED; retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); return retVal; } catch (Exception ex) { throw ex; } } public static bool RemovePrivilege(string privilege) { try { bool retVal; TokPriv1Luid tp; IntPtr hproc = GetCurrentProcess(); IntPtr htok = IntPtr.Zero; retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); tp.Count = 1; tp.Luid = 0; tp.Attr = SE_PRIVILEGE_DISABLED; retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid); retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); return retVal; } catch (Exception ex) { throw ex; } } } } "@ # Take ownership add-type $code [void][CosmosKey.Utils.TokenManipulator]::AddPrivilege([CosmosKey.Utils.TokenManipulator]::SE_RESTORE_NAME) $file = "c:\Windows\Web\Screen\img100.jpg" $user = $env:username $Account = New-Object System.Security.Principal.NTAccount($user) $FileSecurity = new-object System.Security.AccessControl.FileSecurity $FileSecurity.SetOwner($Account) [System.IO.File]::SetAccessControl($file, $FileSecurity) [void][CosmosKey.Utils.TokenManipulator]::RemovePrivilege([CosmosKey.Utils.TokenManipulator]::SE_RESTORE_NAME) # copy file permissions $Acl = Get-Acl "C:\Users\Test" Set-Acl "C:\Windows\Web\Screen\img100.jpg" $Acl Unblock-File -Path "C:\Windows\Web\Screen\img100.jpg" # Replace image file Get-Item -Path C:\screen\img100.jpg Copy-Item -Path C:\screen\img100.jpg -Destination C:\Windows\Web\Screen -Recurse -force # Set registry key $path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" $img = "C:\Windows\System32\screen.jpg" Set-ItemProperty -Path $path -Name LockScreenImage -value $img[/quote]
     
    MikeNomad, Feb 20, 2017
    #4
Thema:

Setting lockscreen image for all users on a network after sysprep

Loading...
  1. Setting lockscreen image for all users on a network after sysprep - Similar Threads - Setting lockscreen image

  2. Images not fitting on lockscreen

    in Windows 10 Gaming
    Images not fitting on lockscreen: I’m trying to customize on lockscreen to be a slideshow. However, none of the images seem to be fitting. I’ve tried to adjust them but they all seem too big. I previously had a slideshow but unfortunately my laptop got wiped and then the laptop updated to a different windows....
  3. Images not fitting on lockscreen

    in Windows 10 Software and Apps
    Images not fitting on lockscreen: I’m trying to customize on lockscreen to be a slideshow. However, none of the images seem to be fitting. I’ve tried to adjust them but they all seem too big. I previously had a slideshow but unfortunately my laptop got wiped and then the laptop updated to a different windows....
  4. Images not fitting on lockscreen

    in Windows 10 Customization
    Images not fitting on lockscreen: I’m trying to customize on lockscreen to be a slideshow. However, none of the images seem to be fitting. I’ve tried to adjust them but they all seem too big. I previously had a slideshow but unfortunately my laptop got wiped and then the laptop updated to a different windows....
  5. User Files gone after running Sysprep

    in Windows 10 Installation and Upgrade
    User Files gone after running Sysprep: Hello All, Recently, I had been having issues with an OOBESettings window in an endless loop, pressing the "Try again" button did nothing appearing after logging in. I followed some advice to run sysprep.exe>Enter OOBE>Reboot. After running it, I proceeded through the setup...
  6. Lockscreen Image is not changing

    in Windows 10 Customization
    Lockscreen Image is not changing: My lock screen image is not changing anymore. I tried every method searching on internet but none solve it. Windows spotlight image is not changing when i start computer every day....
  7. Slideshow or Screen Saver at lockscreen for all users

    in Windows 10 Ask Insider
    Slideshow or Screen Saver at lockscreen for all users: We created some generic jpg's that include information and events that are going on in our company. We have a large conference room with a Windows 10 computer and multiple user accounts on that machine. At first I set my profile to Slide show from the lock screen but...
  8. Windows 10 set default user on lockscreen

    in Windows Hello & Lockscreen
    Windows 10 set default user on lockscreen: I have a computer with Windows 10 professional, and I have 2 accounts on it. One is mine that I use very frequently, the other is for another user who uses the computer less frequently. Whenever I lock my account or when the computer starts up, the lock screen always shows...
  9. Lockscreen image blurry after recent update (?)

    in Windows 10 BSOD Crashes and Debugging
    Lockscreen image blurry after recent update (?): Pretty sure KB4511555 is to blame for my Lockscreen images coming through blurry. No matter which image I choose, they all come through blurry. Despite uninstalling and reinstalling all pertinent drivers the problem continues. Are we supposed to wait for a Microsoft fix for...
  10. Changing registry settings for user profiles and sysprepping

    in Windows 10 Installation and Upgrade
    Changing registry settings for user profiles and sysprepping: All I have been trying - as I did with the Windows 7 image - to change the default user path in the registry to the D drive. As I have been trying, once I change something in the registry, the sysprep appears to fail. Once I restore my changes, the sysprep will work. Can...

Users found this page by searching for:

  1. lock screen chnage with registry setting during sysprep for all

    ,
  2. script to set lockscreen slide show for all domain users using gpo

    ,
  3. lock screen for all user