2012 Scripting Games Beginner Event 1: Use Windows PowerShell to Identify a Working Set of Processes

2012 Scripting Games Beginner Event 1: Use Windows PowerShell to Identify a Working Set of Processes

  • Comments 37
  • Likes

 2012 Scripting Games badge

Summary: Beginner Event 1 of the 2012 Scripting Games uses Windows PowerShell to identify a working set of processes.

About this event



Date of Event

4/2/2012 12:01 AM

Due Date

4/9/2012 12:01 AM

Event scenario

You are the network administrator for a small, single-location company. Your desktops are all running Windows 7, and your servers are all running Windows Server 2008 R2. Your company has a single domain, and Windows PowerShell remoting is enabled on all computers—both servers and desktops. Your boss is concerned because a number of users have complained that their computers are slow. This is surprising and alarming because each user received a new desktop when they were migrated to Windows 7. To better get a handle on what is going on with the desktop computers, your boss has directed you to ascertain the top ten processes that are consuming memory resources on each computer.

You decide, after doing a bit of research, that the working set of each process would be the best property to track. You also decide to use Windows PowerShell to gather the information. An acceptable output is shown in the following image.

Image of command output

Design points

  • There is no need to write a script for this event.
  • The command you use should be CAPABLE of running remotely against other computers in the domain, but you are not required to have multiple computers available for this scenario.
  • Because this command can be a one-liner, aliases are acceptable in your submission.
  • Your command should return an object that could be piped to additional commands.
  • You should be able to write the results of your command to a file if required (but writing to a file is not a requirement for this scenario).

2012 Scripting Games links

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 scripter@microsoft.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 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • It is very tempting to over complicate this one in my opinion. :)

  • When I click on the 2012 Scripting Games: All Links on One Page I get an Access Denied page.

  • Agreed. Me and a colleague just swapped our submissions. Now ive seen just how simple it can be and still fulfill all the requirements im kicking myself.

  • You are so right!

    Of course there's a balance to be struck. To create a more useful and re-usable, IE long term/production oriented solution might involve a bit of extra complexity. Sometimes just a little more effort can pay dividends - as long as you know when to stop! :-)

  • So cool. My VBscripting skills feels litle offended.. So simple, but yet so powerfull.

  • @Michael Moore dont :-) This entry can easily be a one-liner. Keep in mind the guidelines, there is no need to write a script to do this. But, of course, it might take a decent amount of time to actually come up with that one line.

  • @Wilso010 You need to logon and set up your account. See this article blogs.technet.com/.../how-to-register-for-the-2012-powershell-scripting-games.aspx

  • That is the power of Windows PowerShell --- it can do so much with so little code it is amazing.

  • @IamMred Didn't, I went with the kiss method (Keep It Simple Stupid).  Very much looking forward to the next 9. :)

  • Really encouraged at how simple this was. I only picked up powershell last month, but doing this initial exercise really demonstrates how easy it is to learn.

  • @jlsuperman Same here, I just started learning it at the end of February. Such an incredibly powerful tool.

  • it seems so simple that i have the feeling that i misreaded the event guideline. :P

    Well i will know at the end ;)

  • Please DO NOT post answers to these events in the blog comments. It spoils the fun for everyone involved in these games.

  • Submitted an answer, kind of new to Powershell so I don't know if it is correct.  It worked on my machine though, so there is that. :)

  • I've just started to learn Powershell and put an answer together for this fairly easily.  Will be interesting to see if people can make it even more compact.

    Looking forward to Exercise 2 now!