Sunday, February 22, 2009

Get Windows Vista Resource Kit for free now

For years resource kits were extremely useful for understanding changes and principles whenever new OS was released from Microsoft.

I remember 3 resource kits from past – Windows 2000, Windows XP and Windows 2003. Windows 2000 RK was extremely useful – great books and CD with extremely useful utilities, however it was pretty expensive – luckily I had one at my work ;) Windows XP RK was not that interesting – there were not that many changes in XP compared to Windows 2000, so documentation was not really needed to understand it and CD with utilities was very poor.

Windows 2003 RK was again very useful – with downloadable set of utilities, this was must have (and utilities were available for free now).

I haven’t read Windows Vista RK so far, however I always wanted to – and now it is available as ebook for free (Microsoft Press celebrates 25th anniversary).

DON’T WAIT AND DOWNLOAD IMMEDIATELY :)

Monday, February 16, 2009

Simple timespan in PowerShell

In few of my scripts I am using timespan (TimeB – TimeA). Timespan is extremely powerfull in PowerShell, especially if you have ever done it in batches…

These scripts allows administrators to modify timespans. For example I have script that can automatically remove log files that are older than X days – and administrator can specify X value.

To keep it simple, you can use powershell translation, so you can specify timespans in format that is easy to understand:

“00:20:00” means 20 minutes.

To use it in powershell, simply use [timespan]”00:20:00”.

But what if you want to use period of time that is longer than 1 day? If you will try [timespan]”25:00:00”, you get following error:

Cannot convert value "25:00:00" to type "System.TimeSpan". Error: "The TimeSpan
could not be parsed because at least one of the hours, minutes, or seconds com
ponents is outside its valid range."
At line:1 char:11
+ [timespan]" <<<< 25:00:00"

 

Solution is pretty simple – timespan is using format days.hours.minutes.seconds, so you can change it to

1.00:00:00 (1 day) or 5.02:00:00 (5 days and 2 hours)":

PS C:\> [timespan]"5.02:00:00"

Days              : 5
Hours             : 2
Minutes           : 0
Seconds           : 0
Milliseconds      : 0
Ticks             : 4392000000000
TotalDays         : 5.08333333333333
TotalHours        : 122
TotalMinutes      : 7320
TotalSeconds      : 439200
TotalMilliseconds : 439200000

PS C:\>

Tuesday, February 3, 2009

Cloud 1 - emails

This is my first post about my cloud. I can tell you how whole store began.

My girlfriend works in company that is using Exchange server. I still don’t understand why 99% of Exchange administrators got stuck few years ago and almost every company is still using size limitations for mails – usually something around 2 GBs (so situation where free online mail services were few years ago).

She works for marketing company – so most emails got attachments, PDFs with tons of pictures etc. So she needs to clean her mailbox every few days and sometimes she gets rid of very important information that she could use in future.

Normal approach is to specify Archiving – but I really don’t like it, because it already happened to me few times that I simple forgot about .pst file and deleted it during re-installation of my computer. Also I also saw few times corruption of .pst files (not talking about fact that it is limited to 2GBs).

So she came with simple idea – why not to send copy of each email to Gmail account (that is about 7+ GBs at the moment).

Very simple idea, but extremely powerful :) That is when I started to think about creating my “cloud” – having everything stored locally for performance reasons, however store it also (automatically) somewhere online, so I can access is anytime\anywhere.

Simple rule (1 computer with Outlook)

To achieve it, all you need to do is to create Outlook rule to forward all emails to specified address:

1.) Select Rules and Alerts… from your Tools:

image

2.) Click New rule

3.) Select “Check messages when they arrive” (blank rule)

image

4.) Click Next – this means that all incoming mails are processed

5.) Check “forward it to people or distribution list” and specify your mail address. Also check “display a Desktop alert" (last entry) – otherwise this rule will be Server side and by default this is disabled. By checking this entry you will turn the rule to be executed at client.

6.) Next, next, next… Finish… You know the rest

I was quite easy to setup – however as mentioned before, it doesn’t work (however it is something related to local Outlook, configuration is correct).

Complex rule (multiple computers)

Once configured, I started to think that this is really nice solution – having online backup of your mails for free with searching… And that I would like to make it part of my “cloud” project:

- all emails are available locally

- all emails are available online

To make it work, it must be more complex then simple scenario discussed above. Reason is that you also want to have some synchronization between your computers, so not each of them will run these rules (otherwise each computer will send same emails).

To support this, I created new category called backup. I use this to mark that email was processed and backed up centrally.

For this you must create 2 rules. First rule will forward email to Gmail (or any other online mail), second will automatically mark email so it won’t be processed anymore.

First rule:

image

Second rule:

image

Important is ordering of these rules.

HookApplication ressurection & Elevator update

Maybe some of you remember 2 projects I had in past:

1.) HookApplication was concept I always wanted to ressurect. It allows you to specify some actions to execute before application and after application is executed. Or even better, to execute something instead of application ;) Principle was simple – HookApplication acted as debugger for application you wanted to change, so it was always trapped – doesn’t matter whether you run application directly, using shortcut or from different application. Which is very powerful and allows you for example to replace Internet Explorer with Firefox – even in case iexplore.exe is hardcoded to application.

2.) Elevator allowed you to elevate application without getting UAC prompt (selectively).

 

What I always wanted was to combine both projects – that would allow you to do whatever you want, for example lock some applications with passwords, track their usage, replace them with different applications – and in combination with Elevator also specify per-process rules (always silently elevate mmc.exe for example).

I decided I will refresh HookApplication and rewrite it to full .NET application. It shouldn’t be really big issue and I expect we should see first version this month. Integration with Elevator is really simple afterwards – in fact you don’t need to do anything, just create simple plugin.

I learned a lot from both Elevator and HookApplication, so I think it shouldn’t be really hard to rewrite HA and add support for Elevator afterwards.

Sunday, February 1, 2009

Outlook forward rules not processing

Just run into interesting problem that I am not able to solve :(

My girlfriend wants to forward all emails from Outlook to her Gmail account – which sounds pretty easy.

First I tried to set up normal rule – every mail forward to gmail. It was created as server rule and didn’t work, so I expected that got forwarding to external mail address blocked.

As a workaround I specified that I want to display notification – this is simple trick, because it will automatically change rule to Client side.

Now I can see that rule is processed:

1.) Email arrives
2.) Email is forwarded to xxx@gmail.com
3.) Email never arrives

If I try to send email manually, it works. In both cases I can see that email in Sent folder, so I really don’t understand where could be the problem :(

Any idea\suggestion is welcomed :)