“Have you got one of those programs that gets the Windows key?”, My colleague asked me the other week. I said “Just download a key finder application?”, “Yeah I’ve tried that and is showing the code as all B’s”.
You may also just see ‘Product key was not found‘ on some software.
I sent him some more links and got back to what I was doing. He was having no joy with any other software, so I wandered over to have a look.
Solution
Let me save you some time: If you are trying to recover a Volume Licence Key (MAK, Multiple Activation Key) YOU CAN’T, they are deleted from the machine when the machine is activated (apart from the last five characters.)
How To Check If You are Running a Windows Volume Licensed Version;
Run the following command;
[box]
slmgr /dlv
[/box]
Volume Licenced.
You can see that this particular machine is running on a volume licence. You will all note that further down it gives you the last five characters of the actual key “BHCH3”. This is to stop people just extracting a Volume Licence, once activated, because Windows removes the key. It takes the last five characters of the key and stores them in a file called ‘tokens.dat’, You will find it at
You will see the similar information if you run the Microsoft Genuine Advantage Diagnostic Tool;
Retail
To recover a key from a retail version of Windows is easy, most free key finders will recover keys for you.
There is another curve ball, that might set you off in the WRONG DIRECTION as well, if you trawl the forums you will find scripts that will ‘tell you’ they decode the registry keys that usually hold the windows key, like this;
You will see posts that say, “no don’t use that registry key ‘DigitalProductID’ change it to ‘DigitalProductID4’ and it will work”. Well it does work! But sadly the key you get will not.
Download the scripts to see for yourself ‘GetProductKey‘
Related Articles, References, Credits, or External Links
A client who we recently did a WDS (Windows 7) install for, needed to image a couple of Windows XP machines, (They had some software that either would not run, or was not supported on Windows 7).
They asked me for some documentation on how to do this, it’s been such a long time since I imaged any XP machine, so I took the opportunity to document it properly.
Solution
Before you begin, be aware you need to be building your reference machine with a Volume Licenced copy of Windows XP NOT an OEM or Retail copy (i.e. DONT build the machine with manufacturers rescue disks like Dell or HP). If you don’t do this you will need to activate every Windows machine that you deploy with Microsoft.
Make sure the version of sysprep you are using is at the same service pack level as the reference machine or bad things will happen.
1. Build your reference machine, and configure it as you require.
2. Create a folder on the root of the C: Drive called ‘Sysprep”. Insert the Windows XP CD and locate the Deploy cabinet file. (This is ‘like’ a zip file and it’s in the supporttools folder).
3. Double click the support cab, then copy over the sysprep.exe file, the setupcl.exe file and the setupmgr.exe file to your c:sysprep folder.
4. You can now run sysprep.exe and skip to step 13. BUT if you require an answerfile (a script that will answer all the questions Windows will ask while it’s reinstalling post sysprep) then run the setupmgr.exe program, at the welcome screen click next.
5. Create New > Sysprep Setup > Windows XP Professional.
6. Fully Automate > Enter Name and Organisation > Set the Display Properties.
7. Set Time Zone > Enter the Volume Licence unlock code > If you are joining a domain, I suggest generating a random name then changing it later.
8. Set the Local Administrators password > Typical settings will enable DHCP > Supply any domain and domain credentials you need to join your domain.
9. Telephony (I just skip this) > Regional Settings > Languages.
10. Printers > Run Once commands > Additional Commands.
11. Enter a string that will go into the registry, and can be identified later > Finish > Accept the default save path > OK > At this point it looks like it’s crashed, you can manually close the setupmgr.
12. Now you can run sysprep.exe > OK > I select ‘mini-setup’ (If you don’t, it will run the welcome to windows session and play the annoying music you cant turn down!) > If you have installed applications and are going to image the machine click Reseal > OK.
Note: Factory will literally set the machine back to a ‘day one’ install of Windows XP.
The machine will then shut down and can be imaged.
Final Note: If you power it back on, it will rebuild itself and delete the c:sysprep directory. Which is fine unless you are doing some testing and realise you have to do the whole thing from scratch!
Related Articles, References, Credits, or External Links
I jumped on a clients remote desktop services server today and saw;
However when I went to activate;
Windows couldn’t be activated
Error Code: 0xC004F074
Error Description:the Software Licensing Service reported that the product could not be activated. No Key Management Service (KMS) could be contacted. Please see the Application Event Log for additional information.
Solution
Out of the box this version of Windows has installed with a KMS Key, that’s fine if you are going to run KMS, here’s how to set it up. But if you want to activate with MAK key or a retail key then you need to manually change it.
1. Press Windows Key+R > cmd {enter} and execute the following command;
Some versions of Windows 8 (Windows 8 Pro for example) ask for the unlock code as soon as you install them, I installed Windows 8 Enterprise on my PC at home today, and I couldn’t even change my user photo, because Windows hadn’t activated. When I tried, this is what happened.
Solution
As I had not yet installed a Windows unlock code, it’s safe to assume it had it’s in built KMS code, so I would need to change it to my own Windows code.
1. Press Windows Key+X to bring up the Advanced Context Menu >Select ‘Command Prompt (Admin)’.
2. Run the following command (where 12345-ABCDE-12345-ABCDE-12345 is YOUR Windows code);
What used to be the simplest task, has now been overly complicated (Thanks Microsoft!) Simply deploying from a single .msi file would have been far too easy! This procedure uses group policy to install Microsoft Office 2010 via group policy. It uses the Microsoft preferred method of employing startup scripts.
Below I’ve also disabled UAC, I found it was stopping my automated install, (If I ran the script manually I was prompted by UAC to continue – that took me about 3 hours to work out).
It also automatically “Activates” Office as soon as its installed, (using a MAK key). In the following scenario I deployed Office 2010 (Pro Plus) x32 bit to Windows 7 machines. In a clean VMware test environment my target machine took 6 minutes to silently install. So on a production network it will probably take a little longer (be patient). But any more than 10 minutes and the process will time out, if that’s happening make sure you do this.
Solution
1. On a server create a shared folder called Office_2010, give Authenticated Users – read access.
2. . In that folder create a folder called LogFiles.
3. Copy the contents of the Office DVD to this share.
4. Open the shared folder locate the ProPlus.WW folder and open it.
5. Locate config.xml open it with notepad.
Change:
6. You can also change Username and companyname if you wish.
7. Save and exit config.xml
8. While in the Office_2010 folder Shift+Right Click > Open New command windows here.
9. Run setup.exe /admin
10. Accept the defaults on the popup menus.
11. Locate “Licensing and User interface.”
12. Enter a valid MAK license key (Take out the dashes and/or spaces). Tick to accept the EULA, and set the display level to none.
13. Locate “Set feature installation stats”, and set for the Office features you require.
To Set Office to Auto Activate (Without user intervention).
14. Locate “Modify Setup properties” , add a new one.
15. Set the name the value to AUTO_ACTIVATE.
16. Set the value to 1 (number one), and click OK.
Note: If you need to remove previous versions of Office you will find the option to do that in here also.
17. Click File > Save as > Save the msp file in the shareupdates folder (you can call it what you want).
18. Open notepad and paste in the following text:
[box]
setlocal
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Get ProductName from the Office product’s core Setup.xml file, and then add “office14.” as a prefix.
set ProductName=Office14.PROPLUS
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=DC2AOffice_2010
REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=DC2AOffice_2010ProPlus.WWconfig.xml
REM Set LogLocation to a central directory to collect log files.
set LogLocation=DC2AOffice_2010LogFiles
REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************
IF NOT “%ProgramFiles(x86)%”==”” (goto ARP64) else (goto ARP86)
REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
:ARP64
reg query HKEY_LOCAL_MACHINESOFTWAREWOW6432NODEMicrosoftWindowsCurrentVersionUninstall%ProductName%
if NOT %errorlevel%==1 (goto End)
REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a
REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%%computername%.txt
REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End
Endlocal
[/box]
19. Change the ProductName to the correct one you are deploying (search for ProductName in the setup.xml file that’s in the same folder you found config.xml in).
20. Change the THREE values in this script “DC2A” to your servername.
21. Save the file as a batch file (not a .txt file!) and right click the file > copy.
22. On your domain controller Start > Administrative tools > Group Policy management console > either create a new policy and link it to your COMPUTERS or edit an existing policy.
24. Add the batch file you created earlier (open the folder and right click > paste).
Note: That should be all you need to do however – The first time I did this, UAC on the Windows 7 machines blocked the install, so I had to turn it off. You can do that in the same policy.
25. Navigate to:
[box] Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Security Options[/box]
Set the Following:
a. User Account Control Behaviour of the elevation prompt for administrators in Admin approval mode – No Prompt or Elevate without Prompting.
b. User Account Control Detect Application installations and prompt for elevation – Disabled.
c. User Account Control Run all administrators in Admin approval mode – Disabled.
Timing
Policies like this will “time out” if running for more than 600 seconds (10 minutes). Our install may take longer than that, so you may need to set the time out in the policy, Navigate to:
Select “Maximum wait time for group policy scripts” set it to 0 (zero) for unlimited.
26. Close the policy editor.
Note: At this point every time Office starts for a new user, it presents you with:
27. To Suppress that you need to create a USER policy with a Custom ADM Template, download the template here.
28. Note this is a USER Policy, so if you add it to the policy you have already created to deploy Office, then that policy needs to be linked to your users. So I would just create a new user policy and link it separately. Navigate to:
[box] User Configuration > Administrative Templates > Classic Administrative Templates (ADM) > Microsoft Office 2010 > Miscellaneous [/box]
29. Locate the “Suppress recommended settings dialog” and enable it.
Related Articles, References, Credits, or External Links