none
Replacing Default Lock Screen File That's Enforced By Group Policy Via PowerShell Script (Windows 8.1)

    Question

  • Hi,

    Our school uses Active Directory and Group Policy to manage a large group of tablets that the students use. We have a lock screen that must be forcibly set as the default lock screen as it contains important legal information. We already have the Group Policy object that enforces this functionality. However we have made some changes to the image file and created a similar one under the same file name. The idea being that we can just write a script that replaces the old image file with the new one. Having the same name, we should be able to do this and have the lock screen actually change without having to modify the Group Policy object that enforces this default lock screen. I have been able to, in the past, manually replace the old file with the new one in the lock screen images directory and then immediately restart the system, resulting in the lock screen actually changing when the system starts back up. The problem was that when I wrote a script to remove the old file, place the new file in the same directory, and finally restart the computer, the script does not work completely as it should. It does replace the files without error however after it restarts, the lock screen remains the same despite the new lock screen image being the only one in the directory. The following code is that script:

    Remove-Item "C:\Windows\Web\Screen\CATimg107.jpg"
    Copy-Item "C:\Users\<my profile name>\Desktop\CATimg107.jpg" "C:\Windows\Web\Screen"
    Restart-Computer


    I am testing the script on my system (tablet) first, before applying the script via Group Policy to make sure it functions properly. I am an administrator, I am running PowerShell as an administrator, and I am setting the Execution Policy to RemoteSigned before I run the script. The script is replacing the old file with the new file, however after restarting it is still displaying the old lock screen image on-screen. Now, it doesn't even work when I manually replace the file anymore. We have edited the local group policy as the registry is showing that the lock screen is enforced for users and system to be aligned with the policy. We have tried also doing many combinations of updating the group policy via command prompt and restarting the computer. We have even tried logging in as a non-admin user after applying the changes and still, the old lock screen is displayed even though the lock screen location holds the new image file under the same name.

    Any ideas would be very helpful as we have hit a wall.

    Thanks!

    Tuesday, March 24, 2015 11:19 AM

All replies