Category Archives: SCCM 2007

SCCM 2007 – OSD Configuration – Naming Conventions and Task Sequence Queries

I was working on a task sequence consolidation this morning and thought I would throw this one out there in case anyone else has a similar situation.

In our environment, we have several applications which require location-specific parameters… basically, the developers have created different configuration files which are based on the site location of the end-user. If you use task sequences for both OSD and application deployment, this should work for you as well, depending upon your machine naming convention. I prefer to use a convention which is organized as such:

[Location Acronym][Unique Identifier][Departmental Acronym]

i.e.  and machine in Austin with a serial number of 123456 and a department of Technology would be AST123456TECH  –  just an example

Although the application programs have dependencies, the configuration program is the last step in the process. So, I have created the first two dependency programs and then configuration programs for each location dependent upon the last program in the dependency chain. All of these are placed in the same task sequence, in order of dependency, and then I use a WMI query to ensure that the proper configuration program is run at the end of the chain based on machine name. (Machine name just happens to be convenient for us, but you could use this same technique for anything obtainable in the WMI which could be used as a locational identifier.)

Query used for the Austin configuration program:

SELECT * FROM Win32_ComputerSystem WHERE Name LIKE “AST%”

You can follow the results in the SMSTS.log file: (I’ve taken out the time stamps)

Query = SELECT * FROM Win32_ComputerSystem WHERE Name LIKE “AST%”
Expand a string: root\cimv2
Expand a string: SELECT * FROM Win32_ComputerSystem WHERE Name LIKE “AST%”
The WMI condition expression is evaluated to be TRUE
The AND expression is evaluated to be TRUE
The condition for the action (Install – [Location Configuration Program] – AST) is evaluated to be true

Really pretty simple when you look at it, but quite handy for consolidation.

SCCM 2007 – Task Sequence – Corporate Branding During OSD

Although I put this process together a while back, I’ve performed enough testing that I now feel comfortable posting this. As we all know, there are many ways to do things, and some processes do not work in all environments. Hopefully, what I have put together will be helpful for some people. Please post comments should you find issues with the techniques posted here.

 

Corporate Branding:

Many companies find it desirable to “brand” their workstations for consistency or to comply with certain corporate policies. The best time to apply a corporate branding process is at the time of system build, although with a little work, a corporate branding process can be made to replace current user settings. Some companies do not employ these types of practices and chose to implement branding during system refreshes. Please refer to your company’s policies in this area during your branding planning process.

 

Branding task sequence:

This task sequence snippet can be placed anywhere after all drivers, both good and bad, are installed on the workstation being built. Each of the line items below are pointing to specific packages containing the files mentioned. You do not need to create any programs for the packages to work within this task sequence. These could be consolidated to save space within the task sequence, but they are expanded here for learning purposes.

  • Run Command Line – User Mini Pic
    • CMD /C copy /y user.bmp “C:\ProgramData\Microsoft\User Account Pictures\user.bmp”.
    • Graphic should be a max of 128 X 128 pixels for best results.
  • Run Command Line – Guest Mini Pic
    • CMD /C copy /y guest.bmp “C:\ProgramData\Microsoft\User Account Pictures\guest.bmp”
    • Graphic should be a max of 128 X 128 pixels for best results
  • Run Command Line – Copy Theme Graphic
    • CMD /C copy /y [corporate].jpg “%SystemRoot%\web\wallpaper\Windows\[corporate].jpg”
    • Graphic should be 1960 X 1200 pixels for best results.
  • Run Command Line – Copy Theme File
    • CMD /C copy /y [corporate_theme].theme “%WinDir%\Resources\Themes\[corporate_theme].theme”
    • *** See below for specific lines to change in a basic .theme file.
  • Run Command Line – Set Logon Image Registry Key
    • REG IMPORT “Police Key.reg”
    • *** See below for the contents of the registry key.
  • Run Command Line – Create Logon Image Folder
    • CMD /C MKDIR “C:\Windows\System32\oobe\info\backgrounds”
  • Run Command Line – Copy Logon Image
    • CMD /C COPY /Y backgroundDefault.jpg “C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg”
    • Graphic should be 1960 X 1200 pixels for best results.

Theme file specifics:

There are many things which can be customized in the .theme file, but the only lines we are changing for this branding exercise are those which refer to the desired name for the theme and the location of the corporate wallpaper image file.

Find the following sections in the .theme file and customize the line shown for your corporation.

[Theme]

DisplayName=[Your Company’s Official Name for this Theme]

 

[Control Panel\Desktop]

Wallpaper=%SystemRoot%\web\wallpaper\Windows\[corporate].jpg

 

The “Wallpaper” path setting and .jpg name above MUST match the path setting and .jpg name which you have placed into the “Run Command Line – Copy Theme Graphic” line in the task sequence.

 

 

Police Key.reg file:

Remember, modifying the registry is not something to be taken lightly. Always test any adjustments to the registry in a test environment to ensure proper operation prior to implementing in production.

Create the registry file and paste the following text into it: (copy and paste text between the <<>>)

<<>> 

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System]

“UseOEMBackground”=dword:00000001

<<>> 

 

 

Group policy object:

This setting forces the loading of the corporate theme upon first logon of a new user. In our company, we do not prevent users from changing their themes, nor do we enforce a specific theme, but there are group policies to accomplish these tasks. Please see the Windows 7 group policy reference for those settings.

User Configuration > Policies > Administrative Templates > Control Panel/Personalization

          Load a specific theme – Enabled

  • Path to theme file – the path to the corporate theme file (typically C:\Windows\Resources\Themes\corporate_theme.theme)
  • This path MUST match the path you set in the “Run Command Line – Copy Theme File” line in the task sequence.