Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
Should this be CW? –  Lloyd Mangram Oct 2 '09 at 13:45
    
yea there is not real right/wrong answer to this; should have set wiki –  icelava Oct 5 '09 at 1:36
add comment

13 Answers

up vote 21 down vote accepted

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.

share|improve this answer
16  
Conversely, WTF is this? ls -1 *old* | awk '{print "mv "$1" "$1}' | sed s/old/new/2 | sh –  squillman Oct 2 '09 at 14:36
4  
Good point on the fact that windows scripting - particularly VB is very awkward until you start to figure it out. The how - well PowerShell has gone a long way to making it more admin friendly. It's closer to Bash scripting than VBS. –  Zypher Oct 2 '09 at 14:43
2  
BTW- just playing devil's advocate :) WMI is ugly... –  squillman Oct 2 '09 at 14:49
1  
LOL. First, who the hell would do that? Second, the admin is at least already familiar with ls. Third, I would consider sed and awk to be relatively advanced, and certainly in the same arena as the Windows APIs I'm talking about. Third-and-a-halfth, while some (many) Unix scripting commands are complex, you don't have to start there — you can do simple things like simply have a list of commands you're already familiar with — whereas if you want to do virtually anything with Windows, you have this huge learning curve to scale first. Updating the answer, though. –  wfaulk Oct 2 '09 at 14:51
3  
I like the way that when you do something in a GUI in Exchange 2007, it just generates a PowerShell script and runs it. –  Richard Gadsden Oct 2 '09 at 16:20
show 7 more comments

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.

share|improve this answer
    
+1 Great point, there are things that just can't be done by pointing and clicking. –  squillman Oct 2 '09 at 14:42
    
yes the scripts i wrote back into those days automated the created of directories, DACLs permissions, IIS site setups, etc. But my colleagues weren't motivated by that. Took one of them two whole months to learn how to write a script function to return a date in string format. –  icelava Oct 5 '09 at 1:48
    
PS, as you probably know, don't use CACLS, use XCACLS, or your ACL inheritances break. –  Richard Gadsden Nov 11 '09 at 16:59
add comment

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.

share|improve this answer
    
How dare you call me lazy?! Oh, wait... –  squillman Oct 2 '09 at 14:55
6  
laziness is a virtue for the sysadmin! –  Nick Kavadias Oct 2 '09 at 15:06
    
Helllllll yeah! –  squillman Oct 2 '09 at 15:20
2  
In my experience, most admins just continue to overload on manual clicks, and take longer than ever to complete their work. :-) I think there are different categories of laziness, some are lazy to think and just wanna click brainlessly; some are lazy to click and think to reduce that. –  icelava Oct 5 '09 at 1:59
    
at which point you show them how you can replace their job with some code, they cry from the shame & change their ways... or they don't in which case you fire them. –  Nick Kavadias Oct 7 '09 at 23:00
add comment

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.

share|improve this answer
1  
+1 You can lead a horse to water... –  squillman Oct 2 '09 at 14:45
2  
... but you can't make him water ski. –  osij2is Oct 2 '09 at 14:47
    
@squillman: You said exactly what I was thinking. My take on this is: If you have a skill that others lack, use it to market yourself and get ahead (whatever that means to you). Helping others get ahead is certainly admirable, but you can't drag them kicking and screaming. –  Evan Anderson Oct 2 '09 at 14:58
    
@Evan: Do you think that teaching a willing learner is contradictory to "market yourself and get ahead"? If one of the Windows admins were to ask for my assistance (scripting-wise), I'd be hesitant towards doing so but ultimately doesn't teamwork mean going that extra mile an helping them? Just curious to read your thoughts. –  osij2is Oct 2 '09 at 15:46
1  
@osij2is: I'm guilty of helping "willing learners" to such an excess that I've definitely squandered some "opportunities" to bill more hours, make more money, etc. One of my "missions" in life is to advance the use of computers such that, ultimately, it might make somebody's life better. If someone comes to me with an earnest desire to learn I'm more than happy to pass on whatever I can. Having said that, if a "fix" w/o a transfer of knowledge is what's wanted I can do that, too. Sometimes it makes me sad not to be able to "teach a man to fish", but if that's what the situation calls for... –  Evan Anderson Oct 3 '09 at 4:28
show 3 more comments

A mantra I go by is "Work smarter, Not harder". Doing any process more than a few times means that there is usually a way you could script it out to have it done automatically with a mouse click, bash script, or other method. The way I see it, this personally frees me up to do more important tasks that are not so much the "manual labor" of system administration.

Those who want to avoid scripting may have several things running through their head. Perhaps they enjoy the GUI interface and don't want to learn command line or programming. Maybe they think that by scripting something out they are basically reducing their own self-importance. Either way, this is not the kind of employee I would like to have and a reluctance to do any sort of scripting shows what kind of worker they are. I would rather have a problem solver rather than a "dumb" system administrator.

As far as encouraging and motivating them, I would say just to do as you were doing, show the gains in productivity and how it can make their jobs easier. For some, being a Windows System Admin is just a paycheck, and it is going to be hard to motivate them to move beyond the point-and-click mentality that has worked for them the past 10 years.

share|improve this answer
    
Good remembrance on the "problem solver"; a lot of folks i meet just want an instruction booklet that tells them what to do for every possibly conceivable problem. They don't want to think about what's happening; just gimme the Step 1-to-23 to resolve this issue. –  icelava Oct 5 '09 at 2:17
    
I tend to call those people "button pushers", like noted future blue-collar worker George Jetson. –  wfaulk Oct 8 '09 at 4:31
add comment

There are a couple of issues you have to overcome, you've mentioned one, that a lot of administrators don't want to be involved in programming, even as low level as scripting. The other is related to this, and this is a matter of control. When an admin is doing a task manually they know exactly what is happening at each stage. Many administrators may feel that by replacing this with a script they are losing control over the process, particularly if they don't understand scripting, and didn't write the script (and didn't want to write it).

I think this is more of an issue with Windows admins than Unix ones as scripting has been a big part of Unix administration for a long time and is generally something Unix admins learn from the very beginning, where as Windows administration, and its inherent GUI-ness leads to a more manual process and scripting can seem unnatural.

Unfortunately getting developers over this hump is a hard battle. For the admin to still feel they are in control, they need to understand what the script is doing, and so really need to understand and learn how to script, and the only way you’re going to get them to do this is if they really understand what scripting can do to them

It’s all very well saying it'll make things quicker, make life easier etc, but can you prove it to them? Find a task that they hate, that they have to do regularly and try and automate it. If you can take this horrible task, and make it a single click script, they will love you, but more importantly they may see the benefit of using scripts.

share|improve this answer
    
Writing the scripts with good feedback, perhaps some minor interactive control - user-friendly stuff ^^ –  Oskar Duveborn Oct 2 '09 at 13:50
1  
I started learning perl as soon as I realised I could take a particularly horribly long and nasty routine job and automate it. Not looked back since. –  Twirrim Oct 2 '09 at 14:43
    
My point is all these "horrible tasks" they'd still rather do them manually. :-) –  icelava Oct 5 '09 at 1:50
    
sack the lot of them & replace them with a single admin thats an uber-scripter. I'll be cheaper –  Nick Kavadias Oct 15 '09 at 15:00
add comment

[sigh] This is way too prevalent in the Windows world, although I would question your statement about the majority not wanting to pony up and learn to script. The absolute greatest thing I have ever done in my sysadmin career was to learn VB and Perl, which led to VBS, which led MANY other things.

If just showing them doesn't work to motivate, one trick I like to use is to throw out subtle statements in front of management :) Call it sucking up if you will, but it's so not. Show the decision makers the benefits, often it starts proliferating through the group. Don't be a jerk about it, though.

On a more subtle note, it's hard (if not impossible) to change someone. Lead by example!

share|improve this answer
5  
"You know what, i'm pretty sure I can script that so we don't have to spend ongoing manpower carrying that out". Powerful words in front of management :) –  Twirrim Oct 2 '09 at 14:41
1  
I've always believed that only in the Windows world can someone call himself (or herself) an admin with absolutely no programming knowledge. Another comment you could drop in is "Why are you doing that manually? That's what we have computers for". –  John Gardeniers Oct 2 '09 at 23:21
    
Unfortunately, since i have long gone into a development and consultancy career, the admins i encounter now are mainly those of my customers. I do not always have a chance to make them look bad in front of their management or IT lead :-) –  icelava Oct 5 '09 at 1:45
add comment

This question is highly subjective. While I agree with the efficiency and increased control that scripting provides, why does it have to be a mandate? Why do you need to encourage people to use scripting just because you like to use it? Why not let people choose to use the tools they like and prefer?

This question also illustrates a common bias that exists in the IT world: That if I don't script I must not be as smart or as good as someone who does script, and that's wrong. I've known plenty of people who could script better than me, but they couldn't subnet to save their lives or figure out how run a network trace, or configure SQL server to use AWE, or didn't know what the boot.ini file was for, etc., etc.

share|improve this answer
2  
Scripting should be encouraged because it is a proven best practice (nothing was mentioned about it being a mandate, nor do I think it was implied). I honestly haven't seen the "you're not as smart" bias, but I don't doubt that it exists. I would easily dismiss those people as fools... –  squillman Oct 2 '09 at 14:39
2  
How is it subjective? Like you said, scripting improves efficiency. There's nothing wrong with a business mandating tools or processes that increase efficiency. There's certainly nothing wrong with a coworker attempting to encourage others to develop a skill that will make them better system administrators. –  Brian Oct 2 '09 at 15:25
3  
@squillman, who says it's a best practice and isn't that itself subjective. What's best practice for me might not be for you. Is there a study that says that 90% of corporations consider scripting to be best practice. @Brian: Who says it makes them better system administrators? My co-worker can script but can't subnet while I can subnet but can't script, so who's better? No offense intended, just playing devil's advocate here. –  joeqwerty Oct 2 '09 at 16:08
3  
@Joeqwerty: scripting is powerful in comparison to point-and-click as scripting (correctly) can do more tasks in less time and more accurately than us lowly humans could ever do manually. Perhaps the phrase should be: "scripting is a better practice". Your (devil's advocate) argument is more subjective than the claim itself. "What's best practice for me might not be for you." That may be true, but that doesn't mean it's not the best practice. It might mean you can't or don't know how to do it. That's a different problem in and of itself. –  osij2is Oct 2 '09 at 16:43
2  
But your opinion is wrong. ;) Seriously, though, I think avoiding scripting is like avoiding knowing how to subnet. Neither one is good. I mean, if you agree that scripting increases efficiency and control, why are you arguing that we should treat as equal those who avoid it? If you were to hire someone to plow your field, would you rather hire the guy with a tractor or the guy with an ox? –  wfaulk Oct 5 '09 at 3:22
show 11 more comments

Honestly, you can lead a horse to water, but you can't make him drink.

I came up as a SysAd in the Marine Corps about 10 years ago, where there is a wide gap between being an Admin and being a Coder. Being a Coder usually means that you get stuck dealing with the CO's pet project website (getting little of your actual job done...).

Because of this, I resisted learning to code, but once I decided to try it, I had a blast.

As far as drawing someone in, Try using AD/LDAP scripting to lure them in. (I think that it's a bit more accessible than dealing with WMI.) Assign a progression of tasks, say "give me the usernames and email addresses of the people in group XYZ".

I wrote this bit of code to find all users who weren't members of any of the specified groups: https://github.com/gwaldo/LDAP-Inverse-Group-Membership-Report

As far as resources, check out the Microsoft Scripting Guys (who have excellent articles and tutorials) and Scriptomatic2, which I love for digging into WMI.

share|improve this answer
add comment

The next question: why should they script? That will determine the answer.

Presumably, you script because it's more efficient. In that case, you can either show everybody else up, or point out to management that there's more efficient ways to administer the systems and wait for them to take advantage of that in a cost-cutting measure.

Somebody with authority can mandate scripting, by requiring that there be scripts in place to handle most things. How well this will work depends on several things; if just stated like that the scripts are likely to remain woefully inadequate and obsolete, while the admins work as normal.

There's also the question of exactly how this is affecting you. Does it just bother you, or would your life be better if your fellow admins scripted things?

share|improve this answer
    
The main effect is admins wasting their time performing repeated manual chores on multiple machines - longer turnarounds - which can impact our development schedule (always never enough). –  icelava Oct 5 '09 at 1:57
1  
and don't forget that manual tasks are error prone. –  John Gardeniers Oct 8 '09 at 11:34
add comment

I actually had another thought. In relation to the fact that junior Windows admins are used to GUI interactions, maybe it would help if you started them with scripting GUI interaction, with something like AutoIt. This would allow them to get their foot in the door in regards to scripting while still allowing them to use the tools they already know, instead of throwing out their existing tools and making them learn new tools and scripting at the same time.

Then, once they get comfortable with the idea of scripting in general, they can move on to non-GUI scripting. Even if not, though, automating button clicks can still potentially be a big time saver.

share|improve this answer
add comment

I have defined scripts as "Documentation that does the work for you."

Manager: Go spend countless hours creating documentation, that a first grader can understand, that will be stale by the end of the week, for your co-workers to clicketty-click through Task-X.

Employee: I have a script that does Task-X, could I just give them that.

Manager: Sure, after you have finished the documentation I just asked for, document your script as well, with a flow chart.

share|improve this answer
add comment

I have defined scripts as "Documentation that does the work for you."

Manager: Go spend countless hours creating documentation, that a first grader can understand, that will be stale by the end of the week, for your co-workers to clicketty-click through Task-X.

Employee: I have a script that does Task-X, could I just give them that.

Manager: Sure, after you have finished the documentation I just asked for, document your script as well, with a flow chart.

Don't forget that the documentation should be in an MS Word document so as to complicate reading it from the server.

share|improve this answer
    
I forgot that requirement. –  Nathan Hartley Oct 22 '10 at 18:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.