So I am told I was a bit hard on the command-line in my previous post. I feel like this is a good reason to explain my attitude in a greater detail.
The truth is that I don’t see any real contradiction between the two and I think they actually need to be both present to make a good manageability experience.
UI is good. It is intuitive (well, should be) and interactive. It makes learning curve smaller and provides you with a better picture of what is going on and what your options are.
However, once you decide to automate the stuff a bit, or start going into fancy stuff, or want to know “what’s really going on here” – the chances are you are going to start a command-line prompt or your favorite script editor.
Bottom-line is: you need both. Good systems provide you both of them and make the transitions from one to the other easy and intuitive.
Let me give you a few examples to show what I mean:
And have you ever tried recording a macro in Microsoft Office Word or Excel? It is fantastic. I’ve used this functionality each time I could not find something I needed in the systems (e.g. reformatting selected text to remove line breaks). You just click Tools/Macro/Record new macro and do the basic actions, then stop recording, make a few edits of the macro code, and add it as a new toolbar button in the UI. What a great and easy transition from UI to code and back!
PowerGUI is actually doing the same in the PowerShell world. And it shamelessly borrows the code tab concept which Frontpage uses so well:
Let’s have a quick look at how it works. Suppose we want to see the permissions set on mailboxes of a certain group and we want to easily see which of them are inherited.
Sure enough we start by clicking the DLs node in the left-hand tree and click the distribution list we need:
Then click the Members link in the right-hand Actions pane to get the DL members:
Now you see the list of members and you click the Permissions link:
Now we get the list of permissions and click the IsInherited column header to get them sorted by inheritance. Job done:
Want to see what was actually going on behind the scene? Just click the PoweShell code tab:
Nice? Now you can take the snippets and just use them to learn the PowerShell syntax, schedule their execution, or bring them back into the UI elements. The latter however would be a topic of another post.