PowerShell Summit 2014: Reviewing the Iron Scripter

I’ve been pretty busy, lately. It’s taken a while for me to finally get around to looking at the Iron Scripter challenge, alongside the winning code, that went on at the PowerShell Summit this past April. How did the challenge work?

Participants were awarded 1-5 points in each of the following categories:

  • Presentation (formatting)
  • Creativity
  • Use of the Theme Ingredient (being CIM)
  • Taste (functionality)

The challenge was made up of three courses:

  • Appetizer Course
  • Dessert Course
  • Main Course

Read More »

Advertisements

Setting up PowerShell on Core Server 2008 R2

Let’s say you want a Windows server, but you want the mess of the GUI to be non-existent. You want something similar to how you would interact with Linux: a smaller attack surface utilizing it’s hardware resources for the services instead of GUI navigation and execution.

Windows Server Core Editions are your friend. You can use Server 2008 R2, or the new Server 2012, to have this lightweight server.

I am making a tutorial that involves creating a core server domain controller, starting with Server 2008 R2 and then showing the differences in Server 2012. As a quick sample, we will go through setting up Windows Server 2008 R2 Core to have PowerShell server management immediately available.

Read More »

Super Simple Script V

DISCLAIMER: This was originally a way to document what I was learning when I first ran into PowerShell as a student who had no prior scripting experience. The examples given and the posts done in relation to the project most likely do not follow best practices and should definitely be reviewed if they are going to be used in any fashion. You have been warned! 🙂

Now that my hectic semester is over — time for some simple scripts that do some powerful stuff!

For this SSS, with just a few lines, we are able to receive the email addresses of everyone within an AD user group. I whipped up this script when I needed to retrieve the names and emails of everybody in a specific group that were accessing an application in a Citrix XenApp environment:

Read More »

PowerShell Plus & A Vague Update

Just in case you did not know…PowerShell Plus was released for free last month from Idera! Originally, this baby would cost a good chunk of change. Head here for the powerfull free IDE!

I’ve been silent for a while, but I am preparing to upload scripts into their own tab for a “scripting library” here on halfwaytoinfinite. Many of the scripts will be giving credit where credit is due to other bloggers that have contributed greatly to the community, and ended up assisting me when I didn’t know just quite where to start! The PowerShell eBook I am working on and teaching with at Century will also be updated in the near future. Though, I am thinking of really using Tobias Weltner’s massive contribution of a free ebook as seen on PowerShell.com here when it comes to future teaching workshops. I highly suggest it as a free PowerShell resource. Why re-invent the wheel?

Now back to the grind!

 

Future of The PowerShell Project and Learning Python

DISCLAIMER: This was originally a way to document what I was learning when I first ran into PowerShell as a student who had no prior scripting experience. The examples given and the posts done in relation to the project most likely do not follow best practices and should definitely be reviewed if they are going to be used in any fashion. You have been warned! 🙂

Week 4 never came. Instead, the next PSP post is coming a bit late and will have drive-by posts every now and then. I am currently taking an MIT OpenCourseware course for an introduction to computer science, so there will also be little posts of Python (maybe C++ too?).

First off, you should check out this update which allows your Windows 7 workstation to have certain PowerShell cmdlets (like the Active Directory module) available locally. It’s nifty when I am just doing a query, or perhaps running Super Simple Script IV!

Here’s a quickie to use with the Active Directory when querying for the user’s name:

# Loading AD cmdlets, and requesting username
Import-Module ActiveDirectory
$thatdude = “So who ya lookin’ for?”

$thisdude = Get-ADuser $thatdude
$firstname = $thatdude.givenname ; $lastname = $thatdude.surname ; $fullname = “$lastname,$firstname”
$groups = Get-ADPrincipleGroupMembership $thatdude | ft Name
$fullname >> Info.txt ; $groups >> Info.txt ; “” >> Info.txt
notepad ./Info.txt

So whenever I am looking for a users actual name and group membership, I can run the script and just enter their name. The output in the Info.txt document will look like this:

Nietzsche, Friedrich

Name
———
Domain Users
Awesome Town

There you have it. A quick script that can help when comparing user privileges and understanding why one user is accessing something another isn’t. Anyway, see you next time with more cool stuff!

Week 3: Active Directory Power

DISCLAIMER: This was originally a way to document what I was learning when I first ran into PowerShell as a student who had no prior scripting experience. The examples given and the posts done in relation to the project most likely do not follow best practices and should definitely be reviewed if they are going to be used in any fashion. You have been warned! 🙂

The Active Directory is the administrative flagship of Windows platforms. User creation, group creation, permissions, shares, etc. it has it all. What happens if you need to create multiple users because a flurry of new employees and/or interns need to be in the system? What happens when chunks of that list need to be part of certain groups? You can painstakingly take the time to do this manually by way of GUI, or be awesome and use PowerShell!

What is this post about?

  • The Active Directoy
  • New-ADOrganizationalUnit
  • New-ADUser
  • New-ADGroup
  • Super Simple Script III
  • File Permissions
  • Mistake of The Week

Read More »

Week 2: ISE, ExecutionPolicy, and Popup

DISCLAIMER: This was originally a way to document what I was learning when I first ran into PowerShell as a student who had no prior scripting experience. The examples given and the posts done in relation to the project most likely do not follow best practices and should definitely be reviewed if they are going to be used in any fashion. You have been warned! 🙂

Here is some script prepping. Also, some resource links should be thrown up on The PowerShell Project page fairly soon.

What is this post about?

  • ServerManager
  • PowerShell ISE
  • Execution Policy
  • Super Simple Script II
  • Mistake of The Week