Office 365 – Day to Day Migration Commands

Connect to Remote Powershell

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Create a new move request

(with an existing remote powershell open)

$OPCred = Get-Credential ### use CORP\

New-MoveRequest -Remote -RemoteHostName -RemoteCredential $OPCred -TargetDeliveryDomain -SuspendWhenReadyToComplete -Identity -BadItemLimit 5 -WhatIf

IF this proceeds, re-run the new move request cmdlet without -WhatIf to queue an SWRC.

Create a new migration batch

(with an existing remote powershell open)

New-MigrationBatch -name “Batch of Users” -SourceEndpoint -TargetDeliveryDomain -BadItemLimit 5 -CSVData ([System.IO.File]::ReadAllBytes(“C:\Path\To\UserList.csv”))

CSV file should have a single column, named EmailAddress, and should contain each user’s primary SMTP address, one per line

Cutover a single mailbox

The mailbox should have an existing move request to do this, and in the AutoSuspended state.

get-moverequest <upn/username> | get-moverequeststatistics

If everything is okay:

Resume-moverequest <upn/username>

The 2011 Mark Webber Rant

I wrote this in November 2011 but never published it… So rewind and it may make more sense.

It’s no secret, I’m one of Mark Webber’s biggest fans. A disappointed fan, at the moment, but still his biggest fan.

I’m fairly new to this amazing sport we call Formula 1, having only “discovered” it two years ago, and following it religiously for the past twelve months or so.

I’m quite vocal about Mark’s standings this season, not having landed a #1 finish, and having a number of issues with his racing strategy and starting issues. On the other hand, Mark has consistently produced finishes in the top five or so drivers, and sits at fourth in the championship. And it makes me wonder, how can he be so consistent, yet not achieve a win in the 2011 season?

I have varying views on Redbull Racing as a team, and their support  for Mark. Certainly, in the 2010 season, Mark was recorded famously for his remark, “fantastic drive, not bad for a #2 driver” in response to his win at Silverstone in 2010. A catastrophic array of events in the 2011 season begs the question, “is he getting the support he needs”, with his most recent drive in Abu Dhabi being set back by a poor tyre/pit strategy, and perhaps more damaging, a horrible pit stop where the rear left wheel nut was dropped.

Certainly in 2011, Mark is the #2 driver, with Sebastien Vettel’s outstanding 14 wins and championship victory, overshadowing Mark’s prowess in the final leg of many of the races. In one such incident, Mark was very quickly gaining ground on Sebastien in the remaining laps of the race, Christian Horner came over the radio and requested Mark to “maintain the gap”. These team orders infuriated Mark and his fans alike, albeit a sensible decision for the championship. And it is just that, infuriating.

I’m hoping Mark will pick up a few more wins in the 2012 season. I think he is a great driver, very consistent, and very entertaining to watch when he is going head to head with other drivers. It’s a real shame he hasn’t been able to excel as much as his team mate, and I can only dream of him taking the championship next year.


Pirelli mixing up the tyre game again in 2013

It appears from last nights Free Practice sessions (FP1 and FP2) in Malaysia, that Pirelli has really cooked up some funky tyres this year. The past few years have been the same story, new season, new recipe, new issues. But I think we’re in for an interesting one this year.

The Australian Grand Prix saw perhaps a really interesting turn with the super soft tyres. Those who started the race on the SS tyres, were pitting in the first 7-10 laps, showing these tyres just aren’t as durable as last year (from memory, we were looking at 10-15 laps for the super soft tyres).

I’m unsure how many laps had been done on the hard tyres when I clicked on the TV last night, but the hard tyres used in Malaysia are having massive issues with thermal degradation, and there were numerous shots of tyres with bits of rubber just flapping around.

In the middle, we have the medium tyres. And what do you know, these look damned good. At the Australian GP, we were seeing 20-30 laps out of these tyres, so I expect this will be the preferred tyre for most races. Interestingly, this weekend we have the hard and the medium tyres available, as well as the intermediate and wets just in case the track gets a little damp (which it probably will).

Kimi Raikkonen did a fantastic job of tyre management last weekend, and this allowed for him to pull off an amazing two stop strategy which handed him the win. One thing is for sure, making the tyres work, and getting the absolute most out of them, is going to make or break this championship.

Some brief observations:

  • Kimi Raikkonen has great tyre management and great pace
  • Sebastien Vettel has good tyre management and great pace
  • Mark Webber has poor tyre management and good pace
  • Fernando Alonso has good tyre management and great pace
  • Lewis Hamilto has good tyre management and good pace

Australian F1 GP Post Analysis

Kimi had a great win, and his experience here over other drivers shows. It’s not so much his driving, but his tyre management, and ability to drive on tyres that could be worn out more than other – definitely something learned and carried over from his WRC days. It’s great to see Lotus getting a win, and I’ve previously said on here, they are going to be one very competitive team this year. Great work! Grosjean didn’t seem to have the same speed he had last year, but I expect him to continue to be quick this year when he settles in to the new car.

Regarding Red Bull, they had their issues. I am a massive Mark Webber fan and was severely disappointed with his start. McLaren have owned up to this, as the ECU manufacturer for every car on the grid, as something went skewif with his on the formation lap and ended up ruining his start. Unfortunate, I was hoping it would be his first home win, or atleast, better than fourth. I’m a firm believer in “anyone but Vettel”, so no comments there. He also had a great drive as usual, but Red Bull in general still can’t match Kimi’s tyre management skills. This will be an early season issue which will affect all teams as they understand how the tyres work.

McLaren appear to have a much slower car, with Button only finishing in 9th (he took out 1st place last season), so this was an appalling start for them. Perez finishing lower confirms the car just doesn’t work too well…yet. They’ll catch up as the season progresses, and they understand the car, and of course, tyres.

Mercedes seem to have brought another fantastic car to the grid this year, with Hamilton (unfortunately) doing a great job. Rosberg also finished with points (correction: no he didn’t – but his performance up to his retirement was strong) which shows the car is strong and competitive. They will be a strong contender for the championship this year IMO.

Anthony Sutil’s performance surprised everyone, and I’m glad to see him back in a car. Him and Paul Di Resta are very competitive drivers, and last years Force India performance saw them moving up into points finishes for most races. This season should see them continuing to get points, and I expect some podium finishes from both drivers.

And lastly, Ferrari. Fantastic start to the season for them, and Felipe Massa’s performance was second to none. He blew me away with his performance, having suffered alot of criticism for his poor performance last year. Both Massa and Alonso will be fighting for the championship this year, Alonso coming in to the season as the favorite to win this year, on par or second to Vettel.

Great opening race for the season, and I’m sure I’ll be posting alot more this season to add my analysis as a devout “die hard f1 fan” 🙂

For lots more F1 news and commentary, check out the “I’m a Die Hard F1 Fan” page on Facebook

CASE WHEN “I need to learn more T-SQL” THEN GoogleTheResult() END

One of my favorite recent discoveries in my SQL Server work recently, is the awesome T-SQL “CASE…WHEN…THEN” statement. I can’t describe how much I love this thing.

It’s pretty simple really:

WHEN fruit = 'apples' THEN 'not oranges'
WHEN fruit = 'oranges' THEN 'not apples'
ELSE 'neither apples nor oranges'
END AS fruit
FROM fruits

As can be expected, for every row where the column is set to “apples”, this will output “not oranges”. For those with the value “oranges”, it will output “not apples”, and of course, any other value (such as “bananas”) would output “neither apples nor oranges”.

To make things more interesting, you can combine the comparison portion (i.e. x = y) with any WHERE based comparisons, such as:

  • X IN (value1,value2)
  • X >= 7
  • X =1 AND >=27
  • X+Y>27 OR ISNULL(Z,0) = 0
Using the comparison, you can even output different columns as the result. I.e.
  • WHEN columnA is null THEN columnB
  • WHEN columnA+columnB > 27 THEN columnB/(SELECT MAX(columnA) FROM TABLE)

Thanks Google. I really love this statement, it’s allowed for some pretty funky complex T-SQL scripts recently, and made my life alot easier!

Backing up all SQL Server user databases to file

The ultimate lazy backup script. I wasn’t feeling to selective about which databases to backup, and I figured, it’d be best to back them all up, even that testing database I occasionally use for data import/export. Never know when I might need it again…

This sits inside a SQL Server Agent job, and runs nightly. Simple enough really.

All works as expected on SQL Server 2012.

DECLARE @Database varchar(max)
DECLARE @path varchar(max)
SET @path = concat(N'D:\BACKUP\',convert(varchar,getdate(),112),' ALL DATABASES BACKUP.bak')
select name from sys.databases where database_id>4
OPEN my_cursor
INTO @Database
BACKUP DATABASE @Database TO DISK = @path WITH NOFORMAT, NOINIT, NAME = N'SQL Server all user databases backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
INTO @Database
CLOSE my_cursor
DEALLOCATE my_cursor

I’m sure there’s a better way to do this, but there doesn’t appear to be a column in the sys.databases table which denotes a database as a system or user database. Instead, I’ve used the WHERE database_id > 4 – which removes master, model, msdb, and tempdb from the backup.

I left the homeland, Australia, in early January. My employer proposed an opportunity of a lifetime, and alas, here I am now in Seattle, the capital of IT for those Microsoft-ies among us.

One of the things I am passionate about, is photography, and it is on that note of visiting a new city, that I have pulled out my trusty Canon EOS 5D, and put the most expensive toy I own to use. So without further adieu, I present to you, the best of the best of my Seattle photography.