Enjoy Sharing

PowerShell Script to Insert Branding, OEM and Custom Wallpaper

As part of a Windows deployment whether or not using SCCM, MDT or other methods, one thing you probably want to do is customise Windows in such a way that incorporates a corporate image. This script includes customised Lock Screen image, custom wallpaper image and OEM information like logo, support contact, support URL etc.

One requirement is to set a default corporate wallpaper but still allow the user to change it. Although we can address the custom wallpaper using Group Policy, but that will prevent the users from changing it. This is why Group Policy is not used for custom wallpaper like how it is most commonly done. Also preferably we do not want to replace the img01.jpg file which comes with Windows for the wallpaper (which may be another solution to assigning a custom default wallpaper) so that users still have the ability to change it to that if the user wishes.

Important thing to note is, make sure you have your BMP and JPG file is saved in the same location where this script is sitting in. Create all these files as a package and then call the .PS1 file using the Run PowerShell Command task in SCCM/MDT task sequence.

The script first copies the images BMP and JPG to their respective locations then starts to set the OEM information using the Set-ItemProperty cmdlet, followed by making changes to the registry for the default lock screen and default wallpaper.

 

===Start Script===

$Wallpaper = "backgroundDefault.jpg"
$OSDISK=$env:OSDISK

# copy the OEM bitmap
If (-not(Test-Path c:\windows\system32\oobe\info\backgrounds)){New-item c:\windows\system32\oobe\info\backgrounds -type directory}

copy-item $PSScriptRoot\OEMlogo.bmp "$OSDISK\windows\system32"
copy-item $PSScriptRoot\user.bmp "$OSDISK\ProgramData\Microsoft\User Account Pictures"
copy-item $PSScriptRoot\OEMLogo.BMP "$OSDISK\windows\system32\oobe\info\"
copy-item $PSScriptRoot\$Wallpaper "$OSDISK\windows\system32\oobe\info\backgrounds\"
copy-item $PSScriptRoot\$Wallpaper "C:\Windows\Web\Screen\$wallpaper"
copy-item $PSScriptRoot\$Wallpaper "C:\Windows\Web\Wallpaper\Windows\$wallpaper"

# make required registry changes
$strPath = "HKLM:\Software\Microsoft\Windows\CurrentVersion\OEMInformation"
$strPath2 = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background"
$strPath3 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization"
$strPath4 = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"

Set-ItemProperty -Path $strPath -Name Logo -Value "C:\Windows\System32\OEMlogo.bmp"
Set-ItemProperty -Path $strPath -Name Manufacturer -Value "My IT Services"
Set-ItemProperty -Path $strPath -Name SupportPhone -Value "(02)9876-1234"
Set-ItemProperty -Path $strPath -Name SupportHours -Value "7:00am to 7:00pm"
Set-ItemProperty -Path $strPath -Name SupportURL -Value http://example.intranet.myitservices.com/internal_services/IT_services
Set-ItemProperty -Path $strPath2 -Name OEMBackground -value 1

New-Item -Path HKLM:\Software\Policies\Microsoft\Windows -Name Personalization –Force
Set-ItemProperty -Path $strPath3 -Name LockScreenImage -value "C:\Windows\Web\Screen\$wallpaper"

New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies -Name System -Force
Set-ItemProperty -Path $strPath4 -Name Wallpaper -value "C:\Windows\Web\Wallpaper\Windows\$wallpaper"
Set-ItemProperty -Path $strPath4 -Name WallpaperStyle -value "2"

write-host "End of Script"

===End Script===

 

 

 

Enjoy!!!

Advertisements

One response

  1. Nice 🙂

    August 15, 2015 at 7:53 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s