PowerShell for Admins

PowerShell for Admins
Don Jones
PowerShell for Admins

Using Install-WindowsFeature with Offline Source

As you probably know, the Install-WindowsFeature (used to be Add-WindowsFeature; that’s now an alias to Install-) can add Windows roles and features from PowerShell. If your server doesn’t have the installer source on the local disk, then the cmdlet will default to grabbing it from Windows Update - a pain for disconnected servers. Install-WindowsFeature does offer a means of using an alternate local source (like a DVD or file server location), but using it can be a bit hinky.

Don Jones
PowerShell for Admins

How "Quick and Dirty" Becomes "Permanent and Annoying."

Consider the following: $computers = Get-ADComputer -filter * -searchBase "ou=test,dc=company,dc=pri" foreach ($computer in $computers) { write-host "computer $computer" $result = Do-Something -computername $computer Write-Host "$($result.property) and $($result.value)" } Would you ever consider that acceptable? Some folks might well say, “sure! if I was just testing this, throwing in those Write-Hosts is no big deal. Heck, even if I was the only one who was going to use this, Write-Host isn’t bad.

Enrique Puig
PowerShell for Admins

Monitoring SQL Server Backups

One of the most important tasks for the** **DBAs is to ensure that there is a maintenance plan to recover data from a given disaster.  As a DBA we need to design a maintenance plan according to our scenario and business requirements. Do we want to be able to recover data at any point of time? How much data loss can we accept? All these questions and many more must be answered before designing the plan.

Steven Murawski
PowerShell for Admins

Configuring a Desired State Configuration Client

Once we have our pull server in place and we’re starting to create configurations, we need to set up our client nodes to be able to connect to the pull server and how we want the node to behave. The High Points Overview Configuring the Pull Server (REST version) Creating Configurations (one of two, two of two) Configuring Clients (this post) Building Custom Resources Packaging Custom Resources Advanced Client Targeting Examining the Local Configuration Manager The Desired State Configuration agent included in Windows Management Framework 4 (or natively on Server 2012 R2 / Windows 8.

Don Jones
PowerShell for Admins

Why Get-Content Ain't Yer Friend

Well, it isn’t your enemy, of course, but it’s definitely a tricky little beast. Get-Content is quickly becoming my nemesis, because it’s sucking a lot of PowerShell newcomers into its insidious little trap. Actually, the real problem is that most newcomers don’t really understand that PowerShell is an object-oriented, rather than a text-oriented shell; they’re trying to treat Get-Content like the old Type command (and why not? type is an alias to Get-Content in PowerShell, isn’t it?

Don Jones
PowerShell for Admins

The Shell vs. The Host

One thing that’s often very confusing about PowerShell is the difference between the shell itself - what I’ll call the engine in this article - and the application that hosts the engine. You see, you as a human being can’t really interact directly with PowerShell’s engine. Instead, you need a host application that lets you do so. The standard console - PowerShell.exe - is one such host; the Integrated Script Environment (ISE) is another.

Steven Murawski
PowerShell for Admins

Building a Desired State Configuration Configuration – Part 2

Ok, let’s get back to creating a DSC configuration.  If you haven’t read the last post in this series, go back and do that now, I’ll wait.  Now with that out of the way, let’s get back to it… The High Points Overview Configuring the Pull Server (REST version) Creating Configurations (one of two, two of two - this post) Configuring Clients Building Custom Resources Packaging Custom Resources Advanced Client Targeting Picking Back UP Now that we have some of the basics down, we can start to look deeper at how composable these configurations are.

Steven Murawski
PowerShell for Admins

Building a Desired State Configuration Configuration

Now that’s a title!  We’ve worked through my reasoning as to why I want Desired State Configuration (DSC) and how to build a pull server.  Today and in the next post we are going to look at how to create configurations which describe how our target systems are supposed to work. The High Points Overview Configuring the Pull Server (REST version) Creating Configurations (one of two - this post, two of two) Configuring Clients Building Custom Resources Packaging Custom Resources Advanced Client Targeting Building Configurations Configurations are the driving force for DSC.

Steven Murawski
PowerShell for Admins

Building a Desired State Configuration Pull Server

Quick recap, I’m working through a series of posts about the Desired State Configuration infrastructure that I’m building at Stack Exchange, including some how-to’s. The High Points Overview Configuring the Pull Server (REST version) (this post) Creating Configurations (one of two, two of two) Configuring Clients Building Custom Resources Packaging Custom Resources Advanced Client Targeting I started with an overview of what and why.  Today, I’m going to start the how.

Don Jones
PowerShell for Admins

More Congrats!

Another kudos to Jon Walz, host of the long running PowerScripting Podcast, for his first and well-deserved MVP Award!