Skip to content

Customising the RDSH 2012 Start Screen with PowerShell

Technical Article

Capture a template user's Windows Server 2012 Metro Start screen layout and apply it to the default profile so every new RDSH session inherits the same pinned tiles. Includes a parameterised PowerShell function for Server 2012 and the modern Export-StartLayout / Import-StartLayout equivalent for Server 2012 R2 and later.

Categories
MicrosoftRds 2012Windows Server 2012
Tags
Metro MenuRds2012RdshRemote Desktop Services 2012Start MenuPowershellDefault Profile
Customising the RDSH 2012 Start Screen with PowerShell

This script is for Remote Desktop Session Host (RDSH) administrators who want every new user on a Windows Server 2012 RDSH host to land on the same curated Start screen rather than the default tile layout. It copies the binary Start screen layout from a template user into the default profile so newly provisioned user profiles inherit it on first logon.

What the script does

  • Reads appsfolderlayout.bin from a template user's profile under AppData\Local\Microsoft\Windows\Shell\.
  • Stages a copy on C:\StartScreen\ as a backup you can re-deploy later.
  • Optionally writes the layout into C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\ so every brand-new profile picks it up at first logon.
  • Requires elevation: it touches the Default user profile, which is protected.
  • Targets Windows 8, Windows 8.1, Server 2012, and Server 2012 R2. On Server 2012 R2 and later the supported approach is Export-StartLayout / Import-StartLayout, shown further down.

PowerShell

#requires -RunAsAdministrator
<#
.SYNOPSIS
    Copies a template user's Windows Server 2012 Metro Start screen layout
    to the default profile so every new RDSH user inherits it.

.DESCRIPTION
    On Windows 8 / Windows Server 2012 the user's pinned Start screen layout
    is serialised to appsfolderlayout.bin under
    %LocalAppData%\Microsoft\Windows\Shell.

    This function copies that file from a chosen template user to
    C:\StartScreen\ as a backup, and (when -AppliesToAllNew is set) to
    C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\ so newly
    created user profiles inherit the layout.

.PARAMETER TemplateUser
    The username (sAMAccountName) of the local or domain profile to capture
    the layout from. Log on as this user once and arrange the Start screen
    before running the script.

.PARAMETER AppliesToAllNew
    When set, the captured layout is also written to the Default profile,
    so every new user logging on for the first time inherits it.

.EXAMPLE
    Set-RdshStartLayout -TemplateUser 'rdsh-template' -AppliesToAllNew

.NOTES
    Server 2012 only. On Server 2012 R2 and later use
    Export-StartLayout / Import-StartLayout (see the "Modern alternative"
    section in the blog post).
#>
function Set-RdshStartLayout {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [string]$TemplateUser,

        [switch]$AppliesToAllNew
    )

    $sourcePath  = Join-Path "C:\Users\$TemplateUser" 'AppData\Local\Microsoft\Windows\Shell\appsfolderlayout.bin'
    $stagingDir  = 'C:\StartScreen'
    $defaultDir  = 'C:\Users\Default\AppData\Local\Microsoft\Windows\Shell'

    # Sanity check the template profile actually exists.
    $sourceItem = Get-Item -Path $sourcePath -ErrorAction Stop
    Write-Verbose "Found template layout: $($sourceItem.FullName) ($($sourceItem.Length) bytes)"

    # Stage a copy on the C: drive as a backup / redeploy artefact.
    if (-not (Test-Path -LiteralPath $stagingDir)) {
        New-Item -ItemType Directory -Path $stagingDir -Force -ErrorAction Stop | Out-Null
    }
    Copy-Item -Path $sourceItem.FullName -Destination $stagingDir -Force -ErrorAction Stop
    Write-Host "Backed up layout to $stagingDir" -ForegroundColor Green

    if ($AppliesToAllNew) {
        if (-not (Test-Path -LiteralPath $defaultDir)) {
            New-Item -ItemType Directory -Path $defaultDir -Force -ErrorAction Stop | Out-Null
        }

        Copy-Item -Path $sourceItem.FullName -Destination $defaultDir -Force -ErrorAction Stop
        Write-Host "Applied layout to Default profile at $defaultDir" -ForegroundColor Green
        Write-Host 'New users logging on for the first time will now inherit this layout.' -ForegroundColor Cyan
    }
    else {
        Write-Host 'Layout backed up only. Re-run with -AppliesToAllNew to seed the Default profile.' -ForegroundColor Yellow
    }
}

How to use it

# 1. Log on as a non-privileged template user (e.g. rdsh-template) and pin
#    the tiles you want every user to see.
# 2. Log off, then log on to the RDSH host as an administrator.
# 3. Dot-source the function and run it:

. .\Set-RdshStartLayout.ps1
Set-RdshStartLayout -TemplateUser 'rdsh-template' -AppliesToAllNew -Verbose

Modern alternative: Export-StartLayout / Import-StartLayout

On Windows Server 2012 R2 and later (and Windows 8.1+) the supported way to template a Start layout is via the StartLayout cmdlets. They emit an XML file you can version-control and ship via Group Policy.

#requires -RunAsAdministrator
# Run as the template user on the RDSH host:
Export-StartLayout -Path 'C:\StartScreen\rdsh-layout.xml'

# Then as an administrator, apply the layout to the mounted Default profile:
Import-StartLayout `
    -LayoutPath 'C:\StartScreen\rdsh-layout.xml' `
    -MountPath  'C:\'

Import-StartLayout writes LayoutModification.xml into the Default user profile under the mounted volume, which Windows applies on first logon. For locked-down RDSH or VDI estates you can also push the same XML via the Computer Configuration > Administrative Templates > Start Menu and Taskbar > Start Layout Group Policy.

Security notes

  • Run elevated. The script writes to C:\Users\Default, which only administrators can modify.
  • Use a dedicated template account. Do not capture the layout from a real administrator profile: the binary may pin admin-only tools you do not want exposed to end users.
  • Existing profiles are not touched. Only newly created profiles inherit the layout. Existing users keep whatever Start screen they already have.
  • Roll back by restoring the file. Keep the staged copy in C:\StartScreen\ so you can revert by replacing the file in the Default profile, or by deleting it to restore the OEM default.
  • Prefer policy at scale. For more than a handful of hosts, push LayoutModification.xml through Group Policy or Intune rather than running a script on each RDSH server.

Original 2014 script

The original 2014 download was hosted on TechNet Gallery (now retired). The function above reproduces its behaviour using the same file paths and the same template-user / default-profile workflow it described.