Showing posts with label Windows XP. Show all posts
Showing posts with label Windows XP. Show all posts

Thursday, 10 February 2011

XP Mass Storage Drivers on Toshiba Laptops

A common way of installing Mass Storage Drivers for XP is to add a condition in your Task Sequence to query the Model of the machine and apply the relevant driver. The Deployment Guys have a great post on how to do this here.

The basic idea is that you have a step in your task sequence to apply (for example) the Intel(R) PCHM SATA AHCI Controller 4 Port driver.



On the options tab you would have a number of WMI queries which identify the machines that need that driver. In this example you'd probably see things like-

SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Satellite Pro L500%"
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Satellite Pro U500%"
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Latitude E5410%"
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Latitude E4310%"




Unfortunately this type of driver application assumes that there is one chipset per model (in the above example, the Intel HM55 Chipset). This is not always the case. Take the Toshiba Tecra A11.

Some Tecra A11 models have the Intel HM55 chipset. Some have the Intel QM57 chipset. On both models, running the following code would return TRUE-

SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Tecra A11%"

So, how do you identify the revision of the Tecra and therefore the chipset, in your task sequence? You need to query for the partnumber instead of the model. Toshiba store the partnumber of the laptop in Win32_ComputerSystemProduct. In this case the following code would return true for the Tecra A11 with an HM55 chipset-

SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PTSE0E%"




Here are the SELECT statements to use for some of the other Toshiba laptops in the current range.

Toshiba Tecra A11 (Intel HM55 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PTSE0E%"

Toshiba Tecra A11 (Intel QM57 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PTSE1E%"

Toshiba Tecra M11 (Intel HM55 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PTME0E%"

Toshiba Tecra M11 (Intel QM57 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PTME1E%"

Toshiba Portege R700 (Intel HM55 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PT310E%"

Toshiba Portege R700 (Intel QM57 Chipset)
SELECT * From Win32_ComputerSystemProduct WHERE Version LIKE "PT311E%"

So, adding the Toshiba HM55 models to the above example would give us this

Tuesday, 9 November 2010

Set the default domain in XP

One of the problems with using OSD to deploy XP is that the default logon domain after a build is always the local computer. If you refresh your clients on a regular basis this can confuse your users. This hack will allow you to set the default logon domain to be your Active Directory domain instead.

The key trick with this hack is to import this registry file before you join the domain.

Copy and paste the following code into a text file called setdomain.reg


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultDomainName"="YOURDOMAIN"
"CachePrimaryDomain"="YOURDOMAIN"
"AltDefaultDomainName"="YOURDOMAIN"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DomainCache]
"YOURDOMAIN"="yourdomain.com"


In a Run Command Line step use the following command-


regedit /s setdomain.reg

Tuesday, 18 November 2008

Setting Windows XP Themes Programmatically

Configuring the default user account in XP can be a pain. There are many different ways of doing this, but the two most popular ways appear to be

  1. Do all the configuration as the local administrator and then copy the administrator profile over the top of the default user profile
  2. Load the ntuser.dat file from the default user profile into the registry, make your changes and then unload the registry hive

Both methods have issues, but it would seem like the second method is more correct. It's certainly the easier method to use in OSD which is why we are using it. But doing things the correct way highlighted a strange problem.

A new user with a roaming profile would not get the XP Luna theme. They would pick up the Windows Classic theme instead. Why does this happen, and how can we 'fix' it?

The reason we had never seen this before was because of the way we had created the default user profile. In the past we would log in as administrator, active setup would run and be flagged as such in HKEY_CURRENT_USER, the Luna theme would be set up and then we'd copy that profile into the default user. Any user logging in after that point would pick up that profile complete with the Windows XP Luna theme and active setup would never run.

If active setup runs on a user then this command will be executed as part of the theme setup

%SystemRoot%\system32\regsvr32.exe /s /n /i:/UserInstall
%SystemRoot%\system32\themeui.dll

Opening themeui.dll with a hex editor shows us why we get the Windows Classic theme if we have a roaming profile. By calling it with /UserInstall it apparrently calls the function SetupThemeForUser(). This function appears to check for the following things

SZ_REGVALUE_POLICY_INSTALLVISUALSTYLE policy set

SZ_REGVALUE_POLICY_SETVISUALSTYLE policy set

Roaming or HighContrast is on

Not Roaming and Not HighContrast

So it would appear that /UserInstall will behave differently if the user has a roaming profile. Digging deeper into themeui.dll there is an interesting section beginning /InstallVS

/InstallVS: InstallVS() VS=%ls, Color=%ls, Size=%ls

This function is the one that we want. By passing the parameter /InstallVS with the Visual Style we want (Luna) the colour and the size, we can set any theme we like. For example, to set the theme to Luna Blue

%SystemRoot%\system32\regsvr32.exe /s /n /i:"/InstallVS:'%SystemRoot%\resources\themes\luna\luna.msstyles','NormalColor','NormalSize'" %SystemRoot%\system32\themeui.dll

To set the theme to Luna Silver

%SystemRoot%\system32\regsvr32.exe /s /n /i:"/InstallVS:'%SystemRoot%\resources\themes\luna\luna.msstyles','Metallic','NormalSize'" %SystemRoot%\system32\themeui.dll

To set the theme to Luna Olive

%SystemRoot%\system32\regsvr32.exe /s /n /i:"/InstallVS:'%SystemRoot%\resources\themes\luna\luna.msstyles','Homestead','NormalSize'" %SystemRoot%\system32\themeui.dll

So, to force all roaming profiles to use Luna blue edit the StubPath registry entry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{2C7339CF-2B09-4501-B3F3-F3508C9228ED}

And change it from

%SystemRoot%\system32\regsvr32.exe /s /n /i:/UserInstall
%SystemRoot%\system32\themeui.dll

to

%SystemRoot%\system32\regsvr32.exe /s /n /i:"/InstallVS:'%SystemRoot%\resources\themes\luna\luna.msstyles','NormalColor','NormalSize'" %SystemRoot%\system32\themeui.dll