At my workplace we decided to do some workstation branding as part of the SCCM deployment process.
We wanted to do this to deliver some of the great wallpapers that students in our ICT classes were creating as part of their photoshop skills projects.
We didn't want to enforce this wallpaper, we wanted to allow users to change the wallpaper to anything they want in the future. This was more about fun than standardization or enforcement, after all some people might want their children or their favourite pet as their wallpaper.
Unfortunately group policy doesn't cater for this type of deployment, with GPO based wallpaper settings its either an enforced wallpaper or nothing at all.
The solution ended up being a fairly easy and elegant one, instead of forcing the wallpapers via registry or default profile hacks, we simply changed Windows 7's default wallpaper to the one of our choosing.
To do this we made a batch file as follows...
---------------------------------------------------
@echo off
takeown /F "%windir%\web\wallpaper\windows\img0.jpg"
icacls "%windir%\web\wallpaper\windows\img0.jpg" /grant administrators:F
REM del /Q /F "%windir%\web\wallpaper\windows\img0.jpg"
move /Y "%windir%\web\wallpaper\windows\img0.jpg" "%windir%\web\wallpaper\windows\img0.bak" /Y
copy "sccm.jpg" "%windir%\web\wallpaper\windows\img0.jpg"
icacls "%windir%\web\wallpaper\windows\img0.jpg" /grant users:R
---------------------------------------------------
Then simply created a package containing that batch file as a program and added the program as part of our SCCM operating system deployment task sequences. This script also copies the original img0.jpg to img0.bak just in case you need to restore it in the future.
You can take this a step further and pick a random wallpaper from a network location to mix up your wallpapers throughout your environment if you want. The code would look something like this..
---------------------------------------------------
@echo off
setlocal enabledelayedexpansion
set folder=wallpapers
set count=0
set x=0
REM put all the files into a pseudo-array prefixed with "PIC_"
for /r "%folder%" %%a in (*.*) do (
set PIC_!count!=%%~a
set /a count+=1
)
REM Use the 'modulo' function to get a usable value from system variable %random%
set /a x="%random% %% count"
REM Pull the relevant item out of the "PIC_" 'array'
set chosen=!PIC_%x%!
echo using wallpaper %chosen%
takeown /F "c:\windows\web\wallpaper\windows\img0.jpg"
icacls "c:\windows\web\wallpaper\windows\img0.jpg" /grant administrators:F
REM del /Q /F "c:\windows\web\wallpaper\windows\img0.jpg"
move /Y "c:\windows\web\wallpaper\windows\img0.jpg" "c:\windows\web\wallpaper\windows\img0.bak"
copy "%chosen%" "c:\windows\web\wallpaper\windows\img0.jpg"
icacls "c:\windows\web\wallpaper\windows\img0.jpg" /grant users:R
---------------------------------------------------
No comments:
Post a Comment