I love working in AD (Active Directory) with PowerShell. I find that I have had to really dig in to learn some of the syntax nuances that you need to understand to really mine data and change configurations within Active Directory. This puzzle reflects the kind of situation that people have to deal with in PowerShell everyday. I am interested to see what kinds of approaches each of you will take, this is a real chance to learn more of the diversity of methods that can be used in Active Directory with PowerShell. This month Bartek Bielawski has submitted two puzzles, I am going to post the beginner to medium one first and then the advanced one next month. This is going to be a real learning opportunity. Keep the puzzles coming in, Mike F. Robbinson has submitted one recently too, so you can look forward to that in a couple of months. Here we go: During an internal IT audit of rights on your file server it was discovered that certain group had rights to the share used by finance and HR with sensitive data and the main question is: who was able to access these files because of that. When it happens you are attending a conference (surprise, surprise) and can’t really do anything remotely. That doesn’t stop your boss from calling you and asking for help. All she wants is a list of all users that are members of that group. The problem is that this group suffers from snow-ball effect and has multiple nested groups, that contain nested groups, that contain nested… You respond with “use Get-ADGroupMember -Recursive” but your boss complains, that when she tried to use it, she just got some red text on her screen with information, that common delete is not recognized. You roll your eyes and eventually decide to write a short script and send it over e-mail. Luckily, you have sandbox domain controller running on your laptop, so testing your code is not that difficult. As you are in the middle of an interesting talk, you try to make it as simple and minimalistic as possible. You also decide not to try any other tools that require something to be installed on a computer running the code. One call from the boss is enough. Design goals:
It’s probably easiest just to share his solutions as actual script files, so here’s both the Beginner and Advanced versions that he provided, as a ZIP: Solutions Carlo also provided some notes on his thinking: Just a precision concerning the regex: the idea I had was to ‘force’ competitors to think in terms of Unicode categories and block ranges (unknown concept to most I bet). Without digging, some people could come up with an expression like this, which is NOT what we want:
Have you been enjoying our monthly Scripting Games puzzles? Want to keep them going? Then it’s time to jump in and contribute! PowerShell.org is a community site, which means it only works when community makes it work! So come up with your Scripting Games puzzles (you’ve seen the different kinds we’ve done)! Your submission should include:
The puzzle itself. This can include a narrative, example output you want people to achieve, etc.
The solution (in code form, and it’s fine if you put this on GitHub or in a Gist too), along with a narrative of how and why the solution achieves the goal(s).
Ideally, we’d love it if you could also review some of the entries for your puzzle and provide some commentary on ones that you found noteworthy. Submit your puzzle to Dan Iverson, our newly minted GamesMaster, via email to gamesmaster@ (and you should be able to figure out our domain name, as you’re on our site, right?). We’re looking for an April puzzle and beyond! For months where we have no entry, we’ll post a “taking a break” at the top of the month, just so you know. Don’t let us down! Personally, I’d love for this to become enough of a thing that we can start awarding not only top entrants (I have been tracking entries each month), but top puzzle authors - and maybe invite them to a PowerShell Summit where we’ll do a live Scripting Games event one evening! But it only happens if you help make it happen!
Our March 2016 puzzle comes from Carlo Mancini. We’re actively interested in receiving Scripting Games puzzles from members of the community - submit yours, along with an official solution, to us at admin@ via email!
Although we have a couple of puzzles queued up, we’ll be taking a brief break for the month of February 2016. So, no puzzle this month! However, **we are in need of puzzles, including sample solutions and explanations. **This is a community effort, so if you’ve never contributed - now’s a great time to start! Drop an email to admin@ this domain. Include a ZIP file with your puzzle, solution, and explanation - all in plain-text files, please. You can include screen shots, as needed, as PNG files. We’re also in need of a Games Master, who can collect monthly puzzles, queue them up for publishing, and scan reader submissions for noteworthy entries. Drop an e-mail if you’re interested. Belong to a user group? Why not spend some time in your next meeting coming up with a puzzle or two that your group can submit? Make them easy or tricky, fun or devilish - it’s up to you. A user group could also collectively take on the Games Master role, giving you an important activity (reviewing entries and queuing them for publishing) at each monthly group meeting. Become a contributor, and help keep this highly visible part of the PowerShell community up and running!
Our January 2016 puzzle comes from MVP Adam Bertram. We’re actively interested in receiving Scripting Games puzzles from members of the community - submit yours, along with an official solution, to us at admin@ via email!
Our November 2015 puzzle comes from PowerShell.org user [Tim Curwick][1], who created the puzzle based on a challenge he ran across at work. There’s nothing more real-world than this!
Want to attend the newly expanded, 4-day PowerShell and DevOps Summit coming to Bellevue, WA in April 2016? Well you can - if you make your own community contribution!
Our TechLetter newsletter is looking for articles. And, November is of course NaNoWriMo, the National Novel Writing Month. But we aren’t looking for a novel - just newsletter articles! So we’ll call it National PowerShell and DevOps Article Writing Month (NaPoshDoArWriMo). Er. Or something.
Our October 2015 puzzle might take us beyond the realm of one-liners, but it circles back to the August 2015 theme of retrieving information from the web. This is another scenario that actually has a lot of real-world applications, in that there’s a lot of practical uses in the work environment for this technique.