Wednesday 17 October 2012

How to upgrade SCCM 2007 clients to SCCM 2012

You would think upgrading from SCCM 2007 to 2012 would be a relatively easy task, but I've found it a mammoth process. Not only is there no way to "upgrade" to server itself, there is also no clean way to upgrade the clients directly from 2007 to 2012. I am not a big fan of the SCCM client "push" technique, so below is a process that is working for me.

I have put together the following kixtart/batch script combination to uninstall 2007 and then install 2012 in my environment. This might not work for everyone, but I use a combination of computer startup/login scripts and SCCM to carry out maintenance tasks in my environment.



The pre-launch script

Firstly I am calling the main batch script from my kixtart computer startup script. This could all be done in kixtart, but I want this to happen in the background. If I were to use commands like "start /wait" (which I use to ensure the SCCM 2007 client is installed before the 2012 install begins) within the kixtart script itself, this would make computer startup process take way too long.
;spawn SCCM client upgrade into background
IF (EXIST ("c:\windows\system32\ccm\") AND EXIST ("c:\windows\ccm\AAProv.dll")=0)
  SHELL "%comspec% /c start contoso/local\software\sccmclient2012\sccmupgrade.cmd"
endif
The above script simply checks that the SCCM 2007 folder "c:\windows\system32\ccm\" exists on the system and that a SCCM 2012 file "c:\windows\ccm\AAProv.dll" is not installed. It then launches the main upgrade script. You could use any file, I just picked AAProv.dll as it was one of the first files I saw in the directory.



The upgrade batch script

1. Create a new folder and copy the SCCM 2012 client and ccmclean.exe. CCMCLEAN has been floating around since SMS 2003 and while not officially supported, still works well to irradicate unwated SCCM 2007 client installs.

2. Create an empty batch script and enter the following. Obviously you need to replace the consolo.local lines with the relavent paths and MP fqdn in your environment.
REM ensure 2007 is installed properly (can prevent uninstall)
start /wait %windir%\system32\ccmsetup\ccmsetup.exe /logon
REM uninstall sccm 2007
start /wait %windir%\system32\ccmsetup\ccmsetup.exe /uninstall


REM ccm clean
start /wait
\\contoso.local\software\sccmclient2012\ccmclean.exe /all /q

REM 2012 client install
if not exist "c:\windows\ccm\AAprov.dll" (
  if not exist "c:\windows\system32\ccm\core\bin\clicore.exe" (
   
\\contoso.local\software\sccmclient2012\ccmsetup.exe /service SMSSITECODE=SDC SMSCACHESIZE=6144 SMSMP=mpfqdn.contoso.local /UsePKICert
  )
)
REM clean exit
exit 0
The above script works as follows. First I run an INSTALL (yes an install, not uninstall) of the 2007 client with the /logon flag, this will ensure that the 2007 client is installed properly, as an improper install can cause the uninstall to fail.

Next I attempt to do a clean uninstall with the native SCCM /uninstall command, this often fails, so it is followed up with the CCMCLEAN /all command which will remove anything that the native installer misses.

After the uninstall of the 2007 client, two checks are run to ensure the 2007 client is uninstalled and the 2012 client isn't already installed. Then the 2012 client is installed. I use "start /wait" commands to ensure the uninstall steps occur before the 2012 install starts.

I have used this script on a mixed environment of Windows XP SP3 32bit and Windows 7 SP1 32bit with no problems, 99.9% of clients uninstalled and upgraded clean.

This entire process probably won't suit your environment, but hopefully you can take some ideas and apply them to your deployment techniques.

Tuesday 2 October 2012

Gigabyte Tweak Launcher hotkey control tool

Overclockers everywhere rejoiced when Gigabyte released their Gigabyte Tweak Launcher (GTL) software that is capable of adjusting the multiplier, voltages and bus speeds. GTL is super lightweight and perfect for competitive overclocking but unfortunately is has one small downfall, it doesn't support hotkeys. Hotkeys can be an essential part of taking that world record, clocking a higher frequency for one part of a test, then lowering the frequency for a heavy CPU based test.

With the help of the lightweight autoit scripting language I have put together a small script capable of passing commands to GTL via hotkeys, my gtlcontrol script works as follows.



How to use GTLCONTROL

1. Download gtlcontrol.exe and gtlcontrol.ini from my github repositories.

2. Make sure Gigabyte Tweak Launcher is installed.

3. Edit gtlcontrol.ini to set your bclk, voltage and multiplier.

4. There are 3 options for each hotkey "multienable", "voltenable" and "bclkenable".

If you want to enable any of the 3 options set the value to 1, setting the value to 0 disables the respective option.

For example, multienable=1 enables the multiplier. multienable=0 disables the multiplier.

NOTE: Every time you edit gtlcontrol.ini you need to exit and reload gtlcontrol.exe.


5. To use the application, first start Gigabyte Tweak Launcher and then open gtlcontrol.exe. GTL must be running in the background for the hotkey functionality to work.

6. Your hotkeys f1 through to f4 will execute the options you set in gtlcontrol.ini.


NOTES:

The options in the [debug] sections are for debugging, you don't need to touch them.

You may want to disable the teamau splash screen, to do this set title=0

If you don't trust binaries, the source is provided in gtlcontrol.au3 (check out my github), it is written in the autoit scripting language.