Learn about Windows PowerShell
Summary: In Beginner Event 2, you have to find stoppable running services.
About this event
Date of Event
4/3/2012 12:01 AM
4/10/2012 12:01 AM
You are a server administrator for a medium-sized enterprise company. Your boss wants you to write a Windows PowerShell script to shut down servers across the network. Instead of simply shutting down the servers, he wants you to investigate a more controlled shut down of services prior to actually shutting down the server.
As a first step in this process, you need to find all services that are running that will actually accept a Stop command. You need to run this command remotely against trusted computers that have the appropriate ports open through their firewalls, so your command must work against remote computers.
An appropriate output is shown in the following image.
2012 Scripting Games: All Links on One Page
I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at email@example.com, or post your questions on the Official Scripting Guys Forum. Good luck as you compete in this year’s Scripting Games. We wish you well.
Ed Wilson, Microsoft Scripting Guy
i can't find the link to submit my solution. i was able to submit yesterday's solution without any issue. please advise.
you must register here:
am I reading this correct that we only need to find services that can be stopped or do we continue with the shut down process as well?
also I'd like to clairfy the judging criteria, this says "Use the simplest command that will work. You do not need to write an entire script."
does this mean that you will get extra or lose point for making a full script?
I ask because I felt that I got robbed on event 1 for only posting a one-liner when that was all that was asked. (of course the was no feed back as to why the score was what is was)
How did you get your score?
@shiv_09 you use the same link to submit that you did to register: https://2012sg.poshcode.org
@brad no, do not shut down the services, only necessary to identify them.
ArchSpyder64 as the judges grade your script, you will receive a score and possibly comments on your submission. Later, a leaderboard will be displayed that will show who is leading. Keep in mind that any script can be graded at anytime between now and April 15th, so the leader board will change constantly.
@Brad there are five points listed in the design criteria. That means that if your one-linner meets all five criteria it is an excellent submission.
It seems to me that a good scripter knows when scripting is appropriate and when it isn't. Correct?
how do we get the remote computer name ? as parameter ?
@LA Richards This is often true. I am trying to clarify this for these games because in previous years we have had situations where someone turned in a 200 line script when a simple one-linner would suffice. It also depends on the situation. For example, if I do something only for myself, I may not write a script, but instead do a one-linner. But if I am writing something for the help desk to run, I may do a script, and even include a graphical interface to allow them to run the script by point and click.
@rba For this scenario, you can use -computername LocalHost, or $env:comptuername you do not have to write a script that accepts a command line parameter. There are also many other things that can be done as well. In fact, the design requirement only says that the code you use should be CAPABLE of running remotely ... it does not say that your specific code must run remotely.
Not to complain, but I'm finding the judging somewhat confusing. I really like some of the feedback since it tells you what the judge is thinking which is VERY valuable. Unfortunately, a comment of "Does not fully meet requirements" doesn't help me learn how I can improve a script. I've re-read the requirements and the script multiple times and am not seeing what I'm missing. I like the Scripting Games because they're a very good learning opportunity, but I'd like to be able to learn from mistakes if there is something that the judge is seeing. I get that they're doing this for free, and am guessing that there is a LOT of work put into these, but just wanted to put out there that even a small nudge in the right direction is appreciated.
@Dan Yesterday there were hundreds and hundreds of scripts submitted. I am sure that is the same for today. I am hoping that each script submitted will be graded at least two times. When a script event has five design points ... you can translate that to five points. For each point that it does not meet, one point is subtracted. I have written does not meet all the requirements many times in the scripts I have graded. It will take a judge a really long time to list which requirement you script met and which it does not meet. Keep your eyes out for the Expert commentaries that will start next week. Also pay attention to the blogs of the various judges and their tweets as some judges, rather than writing the same thing hundreds of times over and over, prefer to write a blog post. I appreciate your desire to learn, and that is exactly the point of the games, but keep in mind there are only 30 judges, all of whom have other jobs, and some of whom will only be grading at night and on the weekend. The biggest goal is to grade the scripts. The second goal is to provide some feedback when possible.