Friday, 1 July 2011

Windows 7 - Adding additional input languages IME with SCCM or logon script

Automating the process of adding input languages (IME) in Windows has always been convoluted but has got worse with the release of Windows 7.

In some education or enterprise environments it may be critical to deploy images with multiple IME's or perhaps even deploy IME changes to existing computers. There is one easy solution, to add them to your base image, but that is a nightmare in most organizations where the goal is consolidation.

The logical solution is to use the unattend.xml functionality of Windows and deliver the IME's as part of the deployment of the OS, again this has problems. Users have reported using unattend.xml to deliver IME's such as Chinese PRC Pinyan and end up getting Chinese with a US keyboard, which is useless for inputting Chinese characters.

The solution lies in the command line functionality of the intl.cpl, which is the control panel applet that looks after the region settings, by using a specially crafted xml file we can pass the IME's we want to the OS during the build process and include them in the default user profile. Alternatively we could deliver these settings retrospectively to users via a logon script.

For my systems I want a default IME of en-US and a Chinese PRC Pinyan IME as an option for my users. Here is the XML file I produce to achieve this.


XML File Example



<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/></gs:UserList>
<gs:InputPreferences>

<!--en-AU--><gs:InputLanguageID Action="add" ID="0c09:00000409" Default="true"/>

<!--chinese pinyin--><gs:InputLanguageID Action="add" ID="0804:{81D4E9C9-1D3B-41BC-9E6C-4B40BF79E35E}{F3BA9077-6C7E-11D4-97FA-0080C882687E}"/>

</gs:InputPreferences>

</gs:GlobalizationServices>


You can see in the above code that the en-AU IME is set to default while the Chinese Pinyan IME is simply added.This XML file copies these two languages to the system account and to the default user profile. Alternatively you may want to call this via a logon script for a non-privledges user, in which case you should change the CopySettingsToDefaultUserAcct and CopySettingsToSystemAcct variables to "false"

You could add an number of IME's to this XML file, all you need is the InputLanguageID. These can be tricky to work out, but by the help of these two links you should be okay.

For most input languages you can simply refer to this MSDN post titled Locale IDs, Input Locales, and Language Collections for Windows XP and Server 2003. Yes it does say for Windows XP but these also apply to Windows 7.

Some Asian languages such as Chinese break these rules slightly (as you can see above with my enormous GUID style IntputLanguageID. You can refer to this alternate MSDN article titled From KLID to GUID for the InputLanguageID's of these languages.

As with my XML example above it is totally acceptable to mix and match the use of simple and complex InputLanguageID styles.

Once you have created your XML file you need to call it with the control panel init.cpl applet. As I am deploying this as part of my SCCM task sequence, I first copy the file to a location on the computer that I know exists, then execute the script, my batch file reads as follows.

Batch File Example

copy chineseprc.xml %windir%\temp\chineseprc.xml /Y
control.exe intl.cpl,,/f:" %windir%\temp\chineseprc.xml"


Hopefully this can help side-step the heartache that I felt while trying to add additional IME's to my Windows 7 machines without adding them to the default image.

Wednesday, 15 June 2011

Bitcoin cryptocurrency: an overclockers best friend

Anyone that has a seperate system dedicated for overclocking has the problem of finding uses for all the quickly obsoleting hardware they have purchased. Further more most competitive overclockers have piles of hardware and it is normally covered in grease and doesn't have many real world uses.

Enter Bitcoin...

What is bitcoin? (this extract is taken from bitcoin.org)
Bitcoin is a peer-to-peer currency. Peer-to-peer means that no central authority issues new money or tracks transactions. These tasks are managed collectively by the network.
A modern day gold rush...
The fact bitcoin has no central issuing authority means someone needs to issue the currency, thats where your old hardware comes in, specifically GPUs. Bitcoin is based on cryptography and each block of currency can be generated in a process called "Bitcoin Mining". Basically you load the software onto your system, preferably with some AMD GPU's (5870, 5850, 6970 and 6990 are best) and let the mining software generate Bitcoins. If you want to start mining, it is best to consider mining in a pool. That way you get regular small pay outs and have greater chances of making more bitcoins than going solo. I am part of slush's mining pool http://mining.bitcoin.cz/
An end in sight...
This won't go on forever though, as there are currently about 6 million bitcoins in the wild and the process and the difficulty factor will continue to go up (that means it takes longer to generate each bitcoin) until a figure of around 18 million bitcoins are in the wild. At the moment it takes roughly 45 minutes to generate each bitcoin, but some take as little as 5 minutes while others take up to 2 hours.
Cashing in...
Once you have generated your bitcoins, you can cash them in on sites like Mt Gox (http://www.mtgox.com/) which is very similar to a traditional currency exchange but they trade bitcoins for cash. At the time of writing this article I am making 1.56 bitcoins a day, which at the current exchange rate of $19.4 each, I should make roughly $900 a month. That is for NOW though, shortly the difficulty will take another leap (which it does on a periodic basis) and my profit will go down to about $600 a month. There is also a high possibility of the bitcoin exchange rate taking a dive, and that will also effect profitability.
The Rig..
I am using a rig of old parts I had from past overclocking adventures. My current rig is using a Gigabyte 790FX board, with a AMD 965, 4GB of Patriot memory and 3x Gigabyte EAH5870 and a 1050W psu.

If you don't have the parts it could be costly to get in, but this awesome calculator can help work out if it is worth you building a platform. Remember the difficulty could change in the future and make your income go down considerably.

http://bitcoinx.com/profit/

The Outcome..

Well I am only 2 days into my bitcoin adventures but I am liking what I am seeing. I will write another blog post at the end of the month to let you all know if I think its worth my while, how much it is costing me in electritity and if I am going to add another rig into the equation.

All the information you need to get started is here http://www.bitcoin.org/

Wednesday, 8 June 2011

home folders being renamed to "My Documents" - desktop.ini woes

Those admins that have moved from XP to Windows Vista or 7 have probably gone through the desktop.ini woes.

Desktop.ini is the medium in which Microsoft use to give a directory its custom icon or name. For example the My Documents folder has it's custom icon by a reference in the desktop.ini file. Most of the time this works perfectly, but when you are redirecting My Documents from the local location to a network share this can cause problems, especially in education.

We have a requirement for a number of staff members to be able to look at users home directories and view the contents inside. This is easy when the directories are in username format, but when the desktop.ini comes along, it "virtually" renames the folder to "My Documents" and gives it the custom icon.

So the home directories that you create like this.. (see below)






Are changed to this format as soon as a user logs into a computer... (see below)






Microsoft have been kind enough to include a nice fix in their Server 2008 R2 product, that fix is available in the "File Screening Management" functionality provided by File Server Resource Manager.

And the fix...

1. Open "File Server Resource Manager" on the file server that is hosting your home shares.

2. Select "File Screening Management"








3. Select "File Screen templates"

4. Then "Create File Screen Template..."


5. Give the template a name, desktop.ini

6. Set the "Screening Type" to "Active screening

7. Create a new "Maintain file groups", name is desktop.ini and add desktop.ini to files to include, click OK





















8. Tick "desktop.ini" as your file groups to block, then click OK





















9. Now we need to use our newly created template, to block desktop.ini from creating any files on our home shares folder. Click "File Screens" and then "Create File Screen..."

10. Enter your home share local file path as the "File screen path" and select your desktop.ini template under "Derive properties from this file screen template"





















 11. Click create, now desktop.ini is blocked from ever recreating itself in your home share directory.





Remember if you are using DFS you will need to repeat this procedure on each of your DFS file servers. You will also need to cleanup the existing desktop.ini files that have already found their way into users home folders.

Sunday, 29 May 2011

Sharepoint Config SQL logs growing out of control

Today I woke up, bags packed, ready to go to Taiwan for Computex, but I also found a notification from SCOM telling me the SQL box had nearly filled up its harddrive.

Upon investigating I found the Sharepoint Configuration Log has grown to over 6GB in only a few short months, HUH? Why was this happening? I only have a couple of Sharepoint sites and they arn't even heavily used and I do daily SQL backups via Microsoft DPM 2010, shouldn't the logs be truncated at this point?




Actually no, DPM 2010 won't truncated the logs because the Sharepoint databases are set to full recovery mode by default, which is critical for log shipping and mirroring funtionality that you may need with a large Sharepoint farm deployment. I only have a very small Sharepoint deployment but I still don't want to disable the full recovery functionality at this stage.

Instead I have scripted a weekly log truncation via the following SQL Query script.


SHAREPOINT CONFIGURATION LOG TRUNCATION

USE Sharepoint_Config
GO
            DBCC SHRINKFILE(Sharepoint_Config_log, 1)
    BACKUP LOG Sharepoint_Config WITH TRUNCATE_ONLY
            DBCC SHRINKFILE(Sharepoint_Config_log, 1)





This took a LONG time for my 6GB log, but the result was beautiful, huge reduction on my logs and SCOM notification dismissing themselves. Of course you may want or be required to keep your logs in your organiziation. If you have this requirement you can simply export the log before you truncate it.


SHAREPOINT CONFIGURATION LOG BACKUP

BACKUP LOG [Sharepoint_Config] TO DISK=’D:configLogBackup.bak’



Hopefully one is all resolved now!

Saturday, 28 May 2011

Cancelling Telstra voicemail

If you are anything like me you arn't a big fan of voicemail. People are always leaving me voicemail to a service that I don't use then say "but i left you a voicemail message" when I return their call. Further more voicemail diverts can cost you alot of money if you are using global roaming services overseas, something that can be easily avoided.

Thanks to the help of some friends we discovered an easy way to cancel the service that does the call diversions.

If you simply dial #61# send and then #62# send, this will cancel the diversion of both unanswered and unreachable calls. Further more you may wish you dial #67# send to cancel diversion if your phone is engaged when the caller attempts to contact you. To make it easier you can simply dial #002# to cancel ALL diverts, it is a good idea to investigate what diverts you might have on your mobile before doing this kind of operation though.