How to encourage Windows administrators to pick up scripting? [closed]

Posted on

How to encourage Windows administrators to pick up scripting? [closed] – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, scripting, , , .

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?

Solution :

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 & "rootcimv2")

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.

I wholeheartedly agree with your post. Unfortunately, I don’t think there’s much that can be done without support from management and processes in place that enforce using scripts. Given a choice, people will always go with what’s familiar and what’s easy. At times, this may seem like a negative point, but there are times when simplicity and familiarity is a plus.

On the one hand, the Windows system is implicitly meant to be simple/easy while Unix/Linux systems are much more difficult and less forgiving. So who can blame the admins for taking the path of least resistance? While you, or I or numerous other people may recognize the power of scripting, people will eventually learn one way or another. Typically, admins who holdout on scripting learn the hard way. I like to work smarter, others may just like to work.

What are some means to encourage and
motivate administrators that scripting
can really help them in the long run?

I used to think you could motivate people, but the reality is unless you’re in charge of them the probability of successful “motivation” is extremely low. My attitude these days is: those who want to learn, I will help. Don’t be a salesman for a product no one wants regardless of whether they need it. When you help/teach just one person who is motivated (for whatever reason), they will be the catalyst for change. Not you. Just my two cents.

Leave a Reply

Your email address will not be published. Required fields are marked *