User Rating: 5 / 5

Star activeStar activeStar activeStar activeStar active
 


There have been some changes for how you can customise the default user profile in Windows 7.
Microsoft have disabled the standard ‘Copy Profile’ tool and will only support profile copying when done with sysprep.

There are a few limitations for using sysprep to copy the profile:

  • If you’re using an automated ‘build and capture’ task sequence with ConfigMgr (SCCM) you’re unable to log on and make the customisations to the profile before ConfigMgr captures the image
  • Some changes will not be copied. Microsoft has not documented which settings and files get copied. For example, it will not save most taskbar or start menu customisations.

Microsoft’s solution to this is using Group Policy preferences, however they’re still quite limiting and doesn’t provide complete customisation to the profile. For example, you’re unable to enable the “My Computer” icon on the desktop or specify the default background colour for new users. Another good example of the incompleteness with this method is you can change the control panel to have the ‘icon view’ however you cannot select if you want large or small icons.

After some investigation and testing I’ve found that editing the profile through targeted registry changes is the only consistent way to change the default profile. This is also a method which Microsoft will support.

The following instructions will allow you to add profile customisation to your ConfigMgr OS Deployment Task Sequence.
Changes applied:

  • Force Classic Control Panel – Small icons
  • Show the desktop icons for Computer, User's Files, and Internet Explorer
  • Disable Microsoft Office first run message
  • Disable Microsoft Communicator First Run Tour
  • Set default theme (which applies the background colour)

Windows7DesktopCustomised

Step 1: Create a custom Windows 7 Theme file

  1. Log on to a Windows 7 computer
  2. Right-click on the desktop and select ‘Personalization’
  3. Modify the profile as desired and then click on ‘Save theme’
  4. Save the theme file as ‘Win7Profile.theme’
  5. Navigate to C:\Users\%UserName%\AppData\Local\Microsoft\Windows\Themes
  6. MSWin7-CustomPro1
  7. Save the theme file to your temporary working folder, e.g. your desktop.

Step 2: Create the customisations script

  1. In the temporary working folder, create a new text file called ‘Win7ProfileCustom.cmd’
  2. Add the following text

  3. REM ###################################################
    REM ###################################################
    REM ##
    REM ## Apply customizations to Default User profile
    REM ##
    REM ###################################################
    REM ###################################################


    REM ##################
    REM # Registry Edits #
    REM ##################


    REM **********************************
    REM Load Default User registry hive
    REM **********************************
    reg load HKU\DefaultUser "C:\Users\Default\ntuser.dat"

    REM ******************************
    REM Force Classic Control Panel
    REM ******************************
    reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /d 1 /t REG_DWORD /f
    reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /d 1 /t REG_DWORD /f

    REM *************************************************************************
    REM Show the desktop icons for Computer, User's Files, and Internet Explorer
    REM *************************************************************************
    REM Show Computer icon on the desktop
    REG ADD "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 0 /f
    REM Show User's Files icon on the desktop
    REG ADD "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d 0 /f
    REM Show Internet Explorer icon on the desktop
    REG ADD "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{871C5380-42A0-1069-A2EA-08002B30309D}" /t REG_DWORD /d 0 /f

    REM *****************************************************
    REM Disable Microsoft Office first run message
    REM *****************************************************
    reg add "HKU\DefaultUser\Software\Microsoft\Office\12.0\Common\General" /v ShownOptIn /d 1 /t REG_DWORD /f

    REM *****************************************************
    REM Disable Microsoft Communicator First Run Tour
    REM *****************************************************
    reg add "HKU\DefaultUser\Software\Microsoft\Communicator" /v TourPlayed /d "1" /t REG_DWORD /f

    REM *****************************************************
    REM Set default theme
    REM *****************************************************
    reg add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Personalization" /v Themefile /d "%systemroot%\Resources\Themes\Win7Profile.theme" /t REG_SZ /f

    REM ***********************************
    REM Unload Default User registry hive
    REM ***********************************
    reg unload HKU\DefaultUser

Step 3: Copy to your deployment share

To allow the ConfigMgr/SCCM task sequence to run the script you need to save it to a shared folder which can be accessed during the 'build and capture' process.

  1. Copy both of these files to your OS Deployment package on SCCM, for example in the MDT Toolkit package.
  2. Distribute the package to your distribution points.

Step 4: Update your task sequence

  1. Edit your ‘build and capture’ task sequence
  2. Add two new script elements, these need to be after Windows 7 and applications are installed.
  3. Note: if %deploymentshare% is not a valid variable in your environment you may need to specify the full share path
  4. Cmd /c copy "%osdeploymentshare%\Win7ProfileCustom.cmd" "C:\Windows\Setup\Scripts\SetupComplete.cmd"
    Cmd /c copy "%osdeploymentshare%\Win7Profile.theme" "C:\Windows\Resources\Themes\"

SCCM-TaskSetupComplete1

Step 5: Test it out

  1. Save the changes and run a new ‘build and capture’ to test.

Help! It's not working!

Here are some tips to get you on your way:

  • Is the script running? Try applying the customisations to a standalone Windows 7 PC. You will need to save the theme file into the C:\Windows\Resources\Themes folder then run the customisations script.  Log on as a new user (or a user which hasnt logged into the computer yet) and verify if the profile customisations have applied. If it has - your issue isn't with the script, it's at the 'build and capture' stage.
  • Can you access the deployment share during the build and capture process? Enable the F8 support (if you haven't already), during the build and capture process, roughly when the script is meant to run press F8 - the Windows command prompt should appear. Manually type out the two commands - is there an error message? What does it say?
    • Access denied? the account does not have access to the deployment share
    • File not found? did you type the command correctly? Is the command correct at all? Try running it on a standard Windows 7 system - does it work there?


Having troubles with the instructions?  
Take a look at our example download:

To use- extract the ZIP file and run 'install.cmd' as Administrator.

Log on a new user (a user which hasnt logged into the computer before, and/or doesn't have a profile already!)

Full Download: http://mockbox.net/downloads/Windows7CustomiseProfile.zip

Add comment

All questions, comments or feedback are welcome. However we ask that you refrain from leaving unconstructive messages.
If you are having issues with the content covered we ask that you ensure you have followed the steps as detailed, then in your comment state THE STEP NUMBER which you are stuck at and any other relevant technical information (Mac or Windows, operating system version, Internet browser etc.).
We would like to help where possible, and this helps us help you! :)

Please note: due to an increase of comment spam moderation has been enabled. Your comment will be moderated before being published. This typically takes 24 hours.


Security code
Refresh

Comments  

0 # 21century in 2012-11-20 12:26
I carefully read your blog And it satisfied and my problems.
Actually I was searching for someone who can correct my mistake.
This Guide was really helpful for me.
thank you so much [potential spam link removed]
Reply | Reply with quote | Quote
+1 # Dustin Mobley 2012-05-10 14:28
having trouble getting this to work.
I have created a run Command line named Copy Custom profile and in the command line I have cmd.exe /c copy “\\Servername\s etup\SCCM\Scrip ts\Win7ProfileC ustom.cmd” “C:\Windows\Setup\Scripts\SetupComplete.cmd”

After the image finishe the profile is not how it supposed to be and when I check setupcomplete.c md the .cmd is not copied here.
Any ideas?

I have the Copy Custom profile at the very last step before the "Restart Computer"
Reply | Reply with quote | Quote
0 # Site Admin 2012-05-11 06:07
Hey Dustin,

The first thing I would check is if the command works when you type it in manually.

Have you enabled the F8 feature for your deployment yet?

If so, hit F8 at that stage of the deployment and try typing out the command. Take note of the error messaage.

One other thing to check is if the account running the command has access to the folder on the server. Perhaps log onto a standard workstation using the account and try running the command from an Elevated Command Prompt?

I hope you can work the problem out. This solution took some time to perfect but it resulted in us being able to deploy a perfectly customised Win 7 to our end users.

It made our deployment and training so much easier in the long run.
Reply | Reply with quote | Quote
0 # Dustin Mobley 2012-05-08 14:01
Hello. Great article. Is it possible to also configure what items will be pinned to the task bar?
Reply | Reply with quote | Quote
0 # Site Admin 2012-05-11 06:13
Hi again Dustin,

Forgive me for being vague, it's been well over a year since I've had to manage the Windows 7 deployments.

From memory I did try to 'pin' some items to the taskbar and 'Windows' start menu and found it troublesome.
I think the trick was shortcuts cant be pinned, only applications?

Any how, I do think it will get quite complicated trying to do this, but here's a step in (what appears to be) the right direction!

Pin Items to the Start Menu or Windows 7 Taskbar via Script
Reply | Reply with quote | Quote
0 # d4rkcell.com 2012-03-13 14:39
Hi can I take snippets from the above script for example.

reg add "HKU\DefaultUse r\Software\Poli cies\Microsoft\ Windows\Persona lization" /v Themefile /d "%systemroot%\R esources\Themes \Win7Profile.th eme’" /t REG_SZ /f

and insert this into my task sequence as a run command line item? If I insert a run command line item above this one that loads the default user hive and then stick a third run command line item after the main one that unloads the hive.... any advice?
Reply | Reply with quote | Quote
+1 # Site Admin 2012-03-15 22:25
Hi d4rkcell.

I had inconistent results when running the DOS commands straight from the task sequence.

I highly recommend you contain all the DOS customistation commands in a CMD file called 'SetupComplete. cmd' and have it saved to C:\Windows\Setu p\Scripts\Setup Complete.cmd during the task sequence process.

If you're not already aware, SetupComplete.c md is automatically detected and ran by Windows 7 the first time Windows 7 loads.

Hopefully this makes sense!

Reply | Reply with quote | Quote
0 # d4rkcell.com 2012-03-16 07:05
That sounds and looks like it might solve a few issues I am having, thanks! Does this setupcomplete.c md script run when a user logs in or when the task sequence completes and windows loads the login screen? Is it ran as the system account? I hope you don't mind all the questions.

Thanks again!
Reply | Reply with quote | Quote
0 # Site Admin 2012-03-16 07:16
Hey, no problem at all. Hopefully this all comes to some help for you - I know it did for me!

From memory the SetupComplete.c md script runs right before the logon screen appears.

There's also a log somewhere which shows if it was run and what it did - however my memory isnt that great!

Here's the Microsoft page about it all: http://technet.microsoft.com/en-us/library/cc766314%28v=ws.10%29.aspx
Reply | Reply with quote | Quote
+1 # Dave 2012-03-07 20:59
I'm attempting to execute the "Show the desktop icons for Computer, User's Files, and Internet Explorer" portion of this script, but I need to do it manually, in regedit.

Could you lay out the steps for me? I would really appreciate it.
Reply | Reply with quote | Quote
0 # Site Admin 2011-02-08 02:36
Hi Andreas -
No, you do not need to use the 'CopyProfile' option.
The 'CopyProfile' option will only apply changes which have been made manually to the last logged on and modified profile, which is not an option when you're steamlining a 'build and capture' Task Sequence in SCCM.
This method modifies the default user registry hive.
This page has more information about the different options available when needing to customise the Windows 7 Default User Profile - http://mockbox.net/windows-7-tips/227-customise-windows-7-default-profile.html
Reply | Reply with quote | Quote
+2 # Andreas 2011-02-07 09:38
Do you have to enable CopyProfile to get this to work?
Reply | Reply with quote | Quote
0 # James 2010-12-24 22:16
Thanks! - I've been looking for this for ages!
Reply | Reply with quote | Quote