How to encourage Windows administrators to pick up scripting? [closed]
When I worked as an administrator in my first job, I was frustrated that our administration processes with Windows servers were a series of point-and-clicks; we could never match the level of efficiency with the Unix servers which had a group of shell scripts to automate a lot of the work. I soon read about WSH and ADSI and wasted no time learning just how much automation I was able to achieve with scripting.
There was a huge problem though - almost none of my Windows colleagues were really interested in learning scripting. They seemed happy with the manually mouse-clicking chores and were never excited at the prospect of using scripts to do the work on their behalf. I struggled to convince them to pick up scripting skills despite the evident increases in efficiency. I left that job in pursuit of a full-time software development career thereafter.
Almost a decade on working in various environments and different customers, I still encounter Windows administrators mainly possessing this general "mood" where they would avoid scripting as much as possible. Despite the increasing level of accessibility Windows server technologies are opening up for scripting and automation. I am almost certain the majority of administrators are administrators precisely because they absolutely hate performing any kind of programming duties. What are some means to encourage and motivate administrators that scripting can really help them in the long run?
As a Unix and Windows administrator who does a lot of Unix scripting and almost no Windows scripting, I'd say that it is in part due to the incredible awkwardness of Windows scripting utilities and APIs, and the difficulty (maybe non-obviousness would be a better word) of running things remotely on a Windows machine.
I mean, WTF is this?
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Part of the problem, I think, is that there is an API. Under Unix, admins are largely scripting the automation of command-line utilities they already use. Under Windows, you have to use this API that is unfamiliar on every level. For example, what does "impersonate" mean? This is a trivial concept to a Unix admin, who is likely to use sudo and su and be familiar with setuid scripts already. But a Windows admin is unlikely to be familiar with any of that; they might know about "runas" (or the equivalent GUI option), but they are far more likely to log in as an administrator when they need to do something admin-y.
And the documentation on scripting in Windows is miserable. For one thing, it's far more "interpreted language" than script, again because they are using an (unfamiliar) API and not commands that they're already familiar with. But I don't think I've ever found anything useful in Microsoft's documentation that wasn't led into by finding someone who was already doing something close to what I wanted that pointed me in the right direction. Nowhere does there seem to be a list of things-you-can-do. It's like you already have to be familiar with Windows internals in order to do the most basic things.
Not that Unix scripts don't often look like line noise. But a Unix admin can start with a script that does nothing but run simple commands that he already knows. ("I always have to run these three commands in succession. If I just put them in a file together, I can do it in one command!") And then he can later progress as he gets comfortable with the situation. In contrast, there's no way for an admin to script "log into server as administrator; click on Start → Settings → Control Panel; double-click System; click on the Computer Name tab; etc." Yeah, whatever he was trying to get to is probably presented through an API somewhere, but there's no way for him to incrementally find that.
So, to answer the question "how can we get Windows admins to do more scripting?", the answer is, make scripting less alien. How to do that, I don't know.
Honestly, the answer is in Microsoft's hands. There's no reason that they can't have a command line utility to do everything that's done via GUI. (There are actually a lot of them out there now, but they're not advertised, they're poorly documented, and they're inconsistent.) There's also no reason that there couldn't be some hint in the GUI as to what that button actually does. Have a tooltip that shows the API object that's being modified. Or document it in the Help window.
There's no problem in shielding users from the internals, but Windows seems to go out of its way to actively hide those internals, even from those who want to find them.
Give them a task that can really only be done through a script - for example, I once had to script the creation of hundreds of folders and custom permissions for each folder and it had to be updated DAILY. If they were to do this manually, it would be their sole job. The script, which used CACLS among other things to reset permissions based on the output of a delimited text file, took about a day to perfect (the basic script was done in about an hour).
When you start seeing what you can do with scripting, it can be a huge win.
I once hired a sysadmin who outright refused to do any 'programming' I tried to show him the way in leading by example. The best I could get out of him was to use existing code & modify variable assignment or host names ect. to get a job done. Some people are just not bothered with programming, so you need to lower the barrier for them.
Microsoft is making in-roads into this. In SQL Server, it's been possible for a while now to click on stuff in the Management Studio GUI & then dump out a t-sql script of what you've just done. This is great, especially for the not so programming inclined windows sysadmin.
I've noticed that System Centre Virtual Machine Manager has the same view script feature, except it dumps out a powershell script. I think many other product lines are also introducing this.
How to motivate admins into scripting? tough call, a good admin is a lazy admin & that means an admin that will script as much as possible. An admin that has the time to click on things isn't very productive! Overload your admins with so much work, that they have no choice but to script.