Wednesday, August 31, 2005

Another Monad Script

In a blog entry on viveksharma.com, you can see a basic MSH script to create a MSH Here shortcut menu within Windows Explorer. I've tarted the script up a bit, added some checking etc to look like this:


#SetOpenMshHere.msh
#This script writes registry keys needed to add an
#"Open MSH Here" option to the right click
#menu of any folder
#Author Thomas Lee
$key = ls HKLM:\SOFTWARE\Classes\Directory\shell\MSH -ea silentlycontinue
#check if key already exists. If so, stop.
if ( $key) {
Write-Host "Key exists, stopping"
Return
}
# Create the key and populate it - the value is what will appear in the
# Right Click Menu

$new=New-Item HKLM:\SOFTWARE\Classes\Directory\shell\MSHShell
$set=Set-Item HKLM:\SOFTWARE\Classes\Directory\shell\MSHShell "MSH Here"
# Now create the command key and populate it
# First check that it does not exist.
# NB: this script has the location of MSH hard coded
# You may need to change this your site
$key = ls HKLM:\SOFTWARE\Classes\Directory\shell\MSH\command -ea silentlycontinue
if (! $key) {
$new=New-item HKLM:\SOFTWARE\Classes\Directory\shell\MSHSHell\command
$set=Set-item HKLM:\SOFTWARE\Classes\Directory\shell\MSHShell\command "C:\Program Files\Microsoft Command Shell\msh.exe -Noexit -Nologo -Command Set-Location '%L'"
}
# All done - write about it and quit.
Write-Host "MSH-Here Registry Key setup for use"

You can get the latest version of this script from my monad sample scripts page or directly.

Tuesday, August 30, 2005

Short-term Mail Addresses as Anti Spam measure

I've been over to Jetable.org who offer short term disposable and re-directable e-mail addresses. The idea is you use jetable.org to create an email address at their site. Mail sent to this addres is then forewarded on to you. If you are posting in a newsgroup, for example, or signing up for a site whose privacy you are unclear about, you can just create a mail address and use it for a day or a week, or even a month at which point mail sent there just bounces and you do not see it. I've just created a one-month email address: j2w4t5p6sx0oxcm@jetable.net and email to this address is forwarded to my primary email account. This address should last until end-Sept 2005 - when it expires mail sent to the address just bounces.

At first sight, this seems a good idea - not letting your main email address get clogged up with spam. Of course, you do have to trust jetable.org not to sell your mail addresses to spammers or others!

Info on New Microsoft Ergonomic 4000 Keyboard Leaks

Just read about this new Microsoft ergonomic keyboard. I want one! I have two of the older white ergonomic keyboards, but they're old and battered, as well as being filthy! I hope they release them in the UK with the £ and € symbols soon!

Sunday, August 28, 2005

Ebook: Windows XP Hacks at Tal Beta

Just saw this - an e-book of Windowx XP Hacks. Useful, although almost certainly a violation of copyright.

Saturday, August 27, 2005

MSN Messenger 8.0 Feature List

In the same week as Google launched their new chat client, news of is released about Microsoft's next update to MSN Messenger. I like MSN messenger - although I hate the ads and all the eye candy. And that's what is nice about Google Talk - no ads (well yet anyway), and no eye candy. Just a simple chat/talk interface. So while using Talk, we can look forward to what MS will bring us next year.

Friday, August 26, 2005

Jerry Garcia Stamp Petition

As many folks will know, I'm a Grateful Dead and Jerry Garcia fan, with a home collection of their digital music that is huge and growing. I can remembrer where I was when I'd heard of Jerry's Death - it's hard to believe it was 10 years ago.

I recently came across the Jerry Garcia Stamp Petition which aims to get the US Postal Service to release a Jerry Garcia stamp. Please consider signing it!

Monad Team Launches Blog

The Monad team have launched the Monad Technology Blog. It's got some cool stuff about Monad from the team developing the product. I'm trying hard to ensure that samples from this blog are ported to my monad page and sample monad scripts pages.

Wednesday, August 24, 2005

Google Talk Launches

Hot on the heals of an updated Google Desktop, Google have launched a beta of Google Talk. The download is tiny (900k) for what seems a nice little chat client. Unlike MSN, there's no eye-candy adverts etc, just a clean and simple, no frills interface to a straightforward chat client.

Later:

The BBC has a nice discussion of this service.

Wednesday, August 17, 2005

Download details: Solution Accelerator for Business Desktop Deployment Enterprise Edition

Microsoft has published an updated version of it's Business Desktop Deoloymet Soution Accelerator, which comes in two versions: Enterprise Edition and the Standard Edition.

Version 2.5 includes a number of improvements which include: support for unattended installations of x64 systems, the Computer Imaging System contains supports per-build action lists, updated documentation including support for ACT 4.0. Version 2.5 also addresses reliability and manageability of ZTI, including using MOM to monitor ZTI progress.

Saturday, August 13, 2005

SQL Server Geeks Tackle Soduko

My wife has become a soduko junkie - doing most days puzzles in The Times on-line. But I have to admit, the contributors to the SQLTeam.Com forums, in a thread titled So Duko bank holiday challenge have tryly taken the cake.

Saturday, August 06, 2005

Monad Webcast

Microsoft has just put up an on-demand replay of the recent Monad webcast. The webcast can be found on the Microosft Technet site. The presentation is at the 300 level and is part one of two - part two is to be broadcast next week.

Thursday, August 04, 2005

Finding Great Trainers is Hard!

Things must be going well in trainer-land. The firm I work for, QA, has been looking for some time to hire several top-notch technical trainers, but we've not been able to hire anyone! If you, or anyone you know, is a developer trainer, specialising in Java and/or .NET, and are looking for a new opportunity with a great company, then contact me at thomas.Lee{at}qa.com, and attach a CV.

Monday, August 01, 2005

Download the .NET FX 2.0 SDK - And Get MSH

Although you'd not know it from looking at the download page, MSH Beta 1 (June '05 drop) is now available publically - there's no need to go through the process of getting onto the formal beta program. If you just want to play with MSH, then download the SDK and start playing (and take a look at my sample scripts page to get some cool samples to play with while you learn the product).

The SDK can be downloaded one of two ways - either the full package or the web download. The full package (cleverly called setup.exe) is 317 MB, while the web download size will vary depending on what you intall. The web setup program itself is 977KB. Sadly, there appears to be no MSI package for this download, making it just that little bit harder to deploy via Group Policy. Having said that, the program does have a silent install mode, so you could script the installation, and do the install as part of a logon script, or have the user run the script from a web site or email link.

While fantastic thus far, MSH is still evolving. There are a number of features missing (e.g simple COM interop), some features are being changed, and bugs are being fixed. The next drop, which should occur around the time of the PDC in September, promises to bring a number of welcome improvements and changes. So if you are an admin, fed up with the traditional poor command line support, and you want to contribute to the product's development, then please join into the MSH beta programme and use the NNTP news group!

Sunday, July 31, 2005

Vista - Not ready for Prime Time on My Laptop

I've spent most of today trying to get Vista loaded and running on my laptop. It's been a frustrating day, and at the end of it, I've rebooted back to Windows XP.

There is a lot to like about Vista. The new UI offers some great features, such as the bread-crumbs at the top of the screen. These offer greater flexibility in navigation. IE7 offers tabbed browsing and RSS feeds. The new searching and indexing features look very interesting, I'm keen to explore them in more detail. And the new look is both new, but familiar - the basic user's learning curve should not be too steep.

Another neat feature is the install process itself. There's no I386 folder on the product DVD, just a large .WIM file and what looks like WinPE. The old unattend.txt file, loved by Admins every since NT3.1, also seems gone and replaced by an XML file. I've not yet found details on how to script the install yet - and there appears to be no \support\tools\deploy.cab file on the DVD either. There is a sample of this file (unattend_sample.xml) and it looks very interesting.

Sadly, the hardware support and stability let me down badly. The main issues I have are around drivers for the on-board hardware. I've got a Dell Inspiron 8600, and the Dell drivers for the built-in Ethernet NIC, modem and Video do not install. The Video driver installed by the OS fails to start (Vista reports that it's a driver that is not supported). The generic VGA driver is good enough to use for basic configuration tasks, but it only delivers a fully visible screen at 1280x764 (at higher resolutions, parts of the screen are not visible). At that resolution, the Insprion, in common with a lot of laptops, looks pretty awful. The in-built Intel 802.11b wireless adapter works, so I got some networking and Internet access.

Another issue I had consistently was that one Explorer.exe process would regularly drive to 100% CPU or thereabouts and pretty much hang the system. I could move the mouse around, and ctrl-esc brought up the task switcher, but besides from that, the system itself did not usefully respond for periods of up to a minute. This makes it pretty frustrating to use for any length of time.

It's also very big. The Windows folder contains a massive 21,382 files weighing in at 3.41 GB. And despite the bloat, there's no great cleanup in terms of names and locations - stuff's still dumped here and there all over the place (although this is probably some they have to do to avoid breaking applications). By comparison, the Windows folder on my current laptop build of XPSP2 is 2.82 GB and 15, 891 files - and it's got a number of added services (eg the anti-spam service) added too (and all those hot-fix uninstall folders, etc, etc!). I've not spent the time to work out just where the biggest increases are yet - a task for another day.

A bigger concern for me is that most of the AV tools I have access to are not supported. Specifically, Ez-trust 6.2 and Symantec Corporate 9.0 are known to have issues. This makes using Vista fulltime a non starter until I get AV support.

In summary, Vista Beta 2 is just not ready enough for prime time on my laptop. I'll keep the build loaded both on the laptop and in a VM - I look forward to learning the new features. And hopefully there will be a prompt solution to the hardware issues. I'm kind of disappointed with Beta 1. I would have hoped for better hardware drive support. Roll on Beta 2 and better OEM support for Vista.

Saturday, July 30, 2005

Formatting Numbers in Monad

Monad is pretty clever when it comes to displaying and formatting variables. To display a variable you just specify the variable name - either on it's own or with some maths such as:

[C:\]: #display normal number
[C:\]: $number = 123
[C:\]: $negativenumber = -23.23
[C:\]: $number
123
[C:\]: $negativenumber
-23.23
[C:\]: #display with arithmetic on the line
[C:\]: $number-23.23
99.77
[C:\]: #display formatted string
[C:\]: "String with number ($number) inside"
String with number (-23.23) inside
[C:\]: $number = 234
[C:\]: "String with arithmetic (number+1) ($($number+1)) inside"
String with arithmetic number+1 (235) inside

Well, that's all fine and well, but what if you want more control over your formatting? What if you want neat columns of numbers? I did some searching and found a blog posting from the BCL team which described formatting numbers in .NET, using C#. It was a pretty easy matter to convert the basic code presented in the blog entry into to a Monad script that demonstrates how to format numbers into strings. The script is Format-Number.Msh on my Monad sample scripts page.

As the script shows, there are a couple of ways to get nicely formatted numbers in strings. The main tools you use to get formatted numbers is the tostring() method (which every .NET object implements), the format types you can specify to tostring(), and then using the "-F" parameter to format these numbers into a display string. For example:

[C:\]: "{0,5} times 2 equals {1,10}" -f 10, $(10*2)
10 times 2 equals 20

Armed with this, it's just a matter of adjusting the format strings and the lengths of each field to get output just the way you want it.

Vista-A Saturday Morning View

Micrsoft has launched both the formal name for Windows Longhorn as well as Windows Vista Beta 1 iteself. Of course, this is probably only news to folks living in caves (who wouldn't be reading this blog entry anyway)! This is an interesting beta, in that the version I tested was downloaded from MSDN, and not from a private beta programme. So far as I can tell, there is no NDA on this version.

I started the MSDN download on Wednesday evening, but the hotel's wireless connection was pretty poor. After a day in the office (using every bit of bandwidth I could get), I finally completed the download. So it was time to install.

The first thing I found out: Vista is big, VERY big. While we can excuse a bit of debug code during a beta, the DVD image is 2.42 GB - that's right, nearly 4 times the size of XP! No wonder it took getting for 24 hours to download! But that size makes for some other problems - like for example, the fact that VPC doesn't support mounting ISO images this large. While it would be both cynical and accurate to point out that VMware Workstation does support DVD images of this size, I did not have VMware on my laptop to that was out of the question, and so was direcly loading it into VPC. But there was always Plan B - and this worked a treat. I used Daemon tools to mount the DVD ISO image to an H: drive on my host, which VPC then happily accepted.

The install into the VM took several hours on Thursday night - but by early Friday morning I had a Vista VM and was able to start exploring. While it was great for looing around, the VM was slow, and the graphics not great - the Trio card VPC emulates is not overly feature rich, and the emulation going on does hit perf a bit. But it was good enough to see that Vista is both new and familiar. Many of the same things are in the same places, but there area bunch of new features too, along with a new look UI.

The only answer was to install it fully on the laptop. Several hours of moving files around on my D: drive to make enough space, burning a DVD, etc. I left a bunch of large copy commands running (making even more space) and left the installation to Saturday morning. The installation itself went pretty smooth - around 45 minutes or so. After the final reboot, Vista came up and started running an installation programme for legacy drivers (about which more on another day!). This hung the laptop toally - I have to reboot, after which I could manually run the legacy driver installation. It looked ok, nice new background screen, new ions, but at the same time the familiar XP desktop with start bar, etc.

But once rebooted came the fun - getting drivers for the hardware. The video driver picked by the legacy installer simply does not work - the PC rebooted back into 4-bit colour. This was solved by using the built-in VGA adapter but this does not support very high resolution (1024x768) which looks suboptimal on the laptop. The driver found found for the Ethernet nic also failed to install, although the wireless card works OK(albetit slower at 11mbps than the nic at 100!).

The Dell modem driver fails to install initially - with the error that it will only run on XP and 2000. When I changed the modem driver to run in Windows XP compatibility mode, it runs, but fails to find any hardware. The mobile chipset upgrade also fails.

Running the Broadcom NIC setup utility to get the NIC drivers installed, the setup complains that the drivers are not Authenticode signed. The error message states that drivers MUST be authenticode signed in order to work in Longhorn RTM (this is going to cause a lot of issues early on!). After Clicking OK the install program just dies. Trying to manually install this nic (using Device Manager fails too.

I use Etrust AV - after installing it, Longhorn says that there is no AV program loaded, although Etrust looks installed! Given how slow the Wlan card is, I'll be leaving more software installs (generally performed across the network) for another session.

Monday, July 25, 2005

Monad Sample Script Page

I've been playing a lot with Monad, Microsoft's next genereate admin scripting tool (and generated a few blog pages too). To help me understand the product more, I've been playing with writing scripts. I thought a great way to get to know Monad better would be to try to convert some old VBS/WMI/etc scripts and in doing so, get to understand the langage and the underpinnings better.

To that end, I've put up a new sample scripts page at http://www.reskit.net/monad/samplescripts.htm. The idea is to show how MSH can do useful things. Some of the scripts can be pulled into your Profile.msh (or profile.custom.msh). As this gets executed when you start the shell, you end up with a load of cool new features in _your_ shell.

As Monad moves towards release, the community can create a huge repository of features that can leverage the basics of Monad while providing cool features for admins. In writing these scripts thus far, I've found the functions I've devloped are highy useful for me (thus far mainly useful for writing scripts and playing around with Monad). For example, I've defined my own tail, touch, head, plus tp (to run text pad, and Edit-NewFile (aliased enf) to create a new file (touch) then run tp on it to edit it. Versions of tail, head and touch are on the sample script page.

What has been most interesting is to note how, almost naturally, I've started to use the traditional admin script development model:

1. Type some lines directly in the shell. Play around and get something close to what I want. For example, I've created a new drive (web:) that points to \\maui\website\reskit.net. I've also created a web: alias that does a CD to WEB: which made the 1st editing session very much more productive.

2. Pop the lines into a script file, or local function and get basically working. Once I found WEB: useful, I put the function and new-drive into my profile.tfl.msh file.

3. Add the function to #profile.msh and use it regularly. And as I use it, I start to add more 'production oriented " I found that you can't run new-drive multiple times without an error, so I added a check to the script to first check if web: exists and if only if it doesn't, should the new drive get created. I then added a test to see if the target drive exits (it won't when I'm offline for example) and fail more gracefully.

4. The next step would be to recode these functions into a cmdlet, or perhaps create my own hosting environment where these features are built-in. This is beyond me at present.

This leveraging process - writing loads of small little commands that make the job of using the command line shell usable and productive. I'm starting to build up libraries of libararies, if you see what I mean (eg something to parse WMI dates which is useful whenever using WMI and dates!) One of the down sides of the current drop is that the COM: scripting tools don't properly exist (this is coming in the next drop). But it's clear that Monad is gonna be a very interesiting, powerful and useful tool - I'm glad I've started to learn this now!

Friday, July 22, 2005

Monad PDC Talk

Please Click Me!!

PDC'05 - Please Click Me

Jim Truher has announced he's giving a talk at PDC in September on Monad. He currently plans on having a breakout session on the Monad language. He wants to do a deep dive, to show thow expressive it can be. I can't wait!!

Reskit.net Monad subsite

I've put a subsite up on reskit.net devoted to Monad: http://www.reskit.net/monad. Thus far, it's just some links to articles and blog posts. I'm hoping to expand it in due course. Enjoy!

Discovering Networking with Monad and MSH

Monad presents administrators with great features and facilities, but there is a learning curve. One key aspect of learning any new feature or product is the aspect of "discoverability" - the ability to find things out simply. There are several ways to discover things, but the built-in reflection methods are at hand to help (although getting used to Monad and>.NET is a learning curvre!).

With Windows XP, there are over 900 WMI classes returned from the Get-WmiObject -List command, as shown:


[C:\]: $wmi=Get-WmiObject -list
[C:\]: $wmi.length
920
[C:\]: $wmi | format-list
(... a long list not shown!)

WMI class names are relativey self explanatory - so to find all the WMI classes that have 'net' or 'networking', you can do the following:

[C:\]: $netsettings = $wmi | where {$_.__PATH -match "net"}
[C:\]: $networksettings = $wmi | where {$_.__PATH -match "network"}

You can then use these to get the key network class names, as follows:

[C:\]: $netsettings.length
89
[C:\]: $networksettings.length
14
[C:\]: $networksettings | ft __Path

__Path
------
\\KAPOHO61\ROOT\cimv2:Win32_TSNetworkAdapterSettingError
\\KAPOHO61\ROOT\cimv2:Win32_NetworkClient
\\KAPOHO61\ROOT\cimv2:Win32_NetworkProtocol
\\KAPOHO61\ROOT\cimv2:CIM_NetworkAdapter
\\KAPOHO61\ROOT\cimv2:Win32_NetworkAdapter
\\KAPOHO61\ROOT\cimv2:Win32_NetworkConnection
\\KAPOHO61\ROOT\cimv2:Win32_PerfRawData_Tcpip_NetworkInterface
\\KAPOHO61\ROOT\cimv2:Win32_PerfFormattedData_Tcpip_NetworkInterfac
\\KAPOHO61\ROOT\cimv2:Win32_SystemNetworkConnections
\\KAPOHO61\ROOT\cimv2:Win32_TSNetworkAdapterSetting
\\KAPOHO61\ROOT\cimv2:Win32_TSNetworkAdapterListSetting
\\KAPOHO61\ROOT\cimv2:Win32_NetworkLoginProfile
\\KAPOHO61\ROOT\cimv2:Win32_NetworkAdapterConfiguration
\\KAPOHO61\ROOT\cimv2:Win32_NetworkAdapterSetting

Once you have these names, you can begin exploring:

[C:\]: $nw=Get-WMIObject Win32_NetworkAdapter
[C:\]: $nw.length
31
[C:\]: $nw | gm
(long display - deleted)