Archive for the ‘CodeReflection’ Category

Powershell is coming … you can’t run … you can’t hide and you should brushup/learn your syntax as well

May 14, 2010

This This post

Gave me some clues on powershell that were badly needed.

The sitch:

i)   I’m upgrading SharePoint 2007/2010 in place (yip don’t start I was just trying to see what happened).
ii)  Started getting an error that implied that the security privileges of the admin account weren’t in sync.
iii) I wanted to reset the passwords in SharePoint system to those currently set in the AD system.

What I did

i) Booted up the SharePoint 2010 Management Shell (powershell) (stsadm had stopped working at this stage as I was literally mid-upgrade: SP2010 installed but not ‘upgraded’).
ii) Get-Help Set-SPManageAccount (Get-Help is pretty much like ‘man’ from linux in powershell land it is actually useful and tells you how to use all the commands you find along the way).
This link provided me with the information I needed to kick start the relevant commands link.

iii) Having marshaled all this info together you need to start wrestling with the syntax of the parameter options (of which there are many). Long story short make sure you look up each of the parameter types specified and then the relevant pieces of powershell to weave your plain text strings (which you were used to from good ‘ol command line) into strongly typed parameters.

$currentPassword = convertto-securestring “passwordTextjkfdajlkadsj” -asplaintext -force  (converts plain text password into a ‘secure-string’ variable)

Set-SPManagedAccount -Identity “domain\username” -ExistingPassword $currentPassword -UseExistingPassword.

It’s worth mentioning in the above.

i)  $currentPassword represents a variable defined in the first line and used in the second.
ii) -UseExistingPassword is a ‘switch’ parameter that doesn’t need to be defined other than its presence will ‘switch’ the input from the default (often false value I think) to the opposite ‘true’.

Still wresting with this upgrade so I gotta go now … good luck !!

The mysterious middle tier … for SharePoint

May 3, 2010

The Middle Tier Manifesto makes for interesting reading.

One thing I particularly liked was his model for placing SharePoint development into three tiers.

I like this because it allows me to clearly elicit one of my ‘gaps’ in terms of developement experience. So far I’ve found myself oscillating between the first tier (GUI and Admin Interface) and the third tier (full on VS2005/08/10 development with features/solutions). The middle tier has been their the entire time but kind of in my peripheral vision; present but unseen.

I’m now gonna try and get right upto speed with xsl, jQuery and SharePoint designer (wait I think I threw up a little bit just then) and at least get things to state of affairs where I can talk competently about the ‘middle tier’ of SharePoint and why we should(n’t) use it for our next piece of developement work.

Another good refererence/project to check out is the SPServices JQuery library; for a bit of a boost into the world of ‘middle tier’

OOTB Sharepoint – Software emancipation vs. the shackles of technical debt

April 30, 2010

Good friday reading regards the argument

Never use Sharepoint OOTB


SharePoint OOTB is totally worth it

Having reviewed the above and working in an organisation at the moment where OOTB is the current mantra (and in-house joke amongst the developers) I find myself fascinated by the questions/propositions of OOTB vs. Customisation and (at the moment) without a rock solid position on the matter.

Some things I do think though are:

– There is a conceptual divide.

  • Some devs are like –  ‘the software is mine and any customisation needs be done by me or via software that I create’. This school is quite open to more efficient methods like TDD, Unit testing, refactoring, agile etc. but the idea that they’re the ones in control stays at the forefront af the approach.
  • Other devs (I think like me) look at something like SharePoint and go ‘Awesome’ now I can have the customisations taken care of by users who know what they want (or think they do 😉 While we focus on building awesome infrastructure and tools to allow them to do it. The classic example is page design/layout. The amount of back and forth that can occur trying to get the design to be exactly what some designer/client wants it to be can easily drive me to drink (not a very long drive on a Friday night I’ll admit ;-); So the idea of giving that user tools they can understand and telling them ‘give me a yell when your done’ seems massively appealling. I like the idea of software dev as a ‘role’ versus software dev as a function. Software dev/Information system mgt. has to occur; but whether it’s an individuals whole job (like me) or 10% of everyones job (distributed design tasks) is a question/debate worth having as the world moves on and 90% of your train ride co-passengers spend 80% of their time update facebook pages.

That’s all I got for now but I’ll keep following the issue.

You mean people right ?

April 28, 2010

Skorks points out that refering to IT workers as ‘resources’ is quite dehumanising and a little bit insulting.

He suggests the next time someone talks about ‘resources’ at your organisation you should reply

“you mean people, right ?”

I’m totally gonna use that ..

I agree with his point, I think dehumanising everything makes folks feel better (like their organisations are some sort of well oiled money making machine).

The danger I perceive as at least two fold.

i)  Like Skork points out, people don’t like being refered to machine parts.
ii) People are, in fact, not machine parts. Expecting them to behave so is likely to lead to disappointment somewhere down the line.

I’m afraid you’ll have to live without a heater.

April 9, 2010

One time our car started leaking water from weird places so we took it to the mechanic.

The mechanic checked it out and diagnosed that the pipe (I want to say radiator) that fed water to the interior heater was leaking.

Then he gave us a ‘choice’.

i)  Close some valve so no water got to the leak with the consequence that the heater would never work again (cold Melbourne winters anyone??).
ii) Pretty much deconstruct the engine/front of the car (at vast expense)  in order to get to the pipe to plug the simple leak then put the car back together again.

Point of the story is that while the fix seemed (and probably was) quite mundane and simple, the effort required to expose the problem area was great due to the integration and entanglement of so many other car parts.

This afternoon I basically wrangled my way through a jungle of code (the car engine) to fix 2 lines of a stored procedure. Because the code was monolithic, entangled and generally the opposite of O-O there was a lot of work to do in order to implement a 30 second fix.

It’s just nice to sit back and realise that sometimes those O-O ninjas aren’t just bullshitting us. This sort of stuff can cost you ‘Big Time’ later on down the road.

“Dad what’s the point of this story … I like stories” – Bart and Homer J. Simpson.

I had not realised how far we’d come

April 9, 2010

I got asked in an interview recently a question I tend to get a lot. What’s your ‘favorite’ feature of .net 3.0/3.5/4.0.

Anyway last time I got this one it was actually a bit of a stumper, cause I couldn’t list for you off the top of my head what the new features were in that release(s).

Anyways that motivated me enough to go and actually look it up and it turns out that 3.0 was when M$ brought the frameworks WPF, WWF and WCF.

Turns out I’ve been immersed in the stuff for so long I’d completly blanked on it ever not  being there. So there you go, now they’ll regret the day they ask me that question again when I end up working there ear off about Workflow is ART.