Five Quick Tasks Made Easy with PowerShell

Note: an edited version of this story ran on on December 13, 2017.

I’ve written a lot about PowerShell on this site, but my favorite thing to do is show how to apply the scripting language to various tasks you already have to do as part of your regular role and responsibility. In this piece I’ll take five common administrative tasks that with a GUI would take time and be rote and boring and I’ll show you how to script them using PowerShell. Without further ado, let’s get started.

One – Checking for the presence of patches with PowerShell

As of this writing, the Petya ransomware (well, it is not exactly ransomware since there is no evidence that one could ever recover the files that the worm actually deletes rather than encrypts, as it lets on in its user communications during execution) has disabled most of the IT assets in the country of Ukraine and locked out several global financial and logistics firms from much their own hardware and software. In fact I am an unwitting participant—my e-mail address has been mistakenly included—in an emergency e-mail chain from employees in a very large company that are desperate to communicate with each other using their personal addresses and accounts to keep their business running. This is a very disruptive time.

What’s more problematic is that the vulnerability that this malware uses to enter was patched three months ago. Hopefully your enterprise has a robust patch management platform with all the resources that you need to patch regularly, consistently, and early enough to not be victims. But apparently that hope is just that, as that e-mail thread and hundreds of news reports confirm. So how can we leverage the power of PowerShell to look for at least the missing patch that would mitigate this particular malware variant?

PowerShell supports looking for hotfixes, of course, via the Get-Hotfix cmdlet. Let’s build on this concept to see how we might get a quick and dirty survey of our patching situation going. First, we can use Get-Hotfix on a single computer. Use the –ID parameter, and for its value, enter the Knowledge Base number corresponding with the patch. For reference, the patch that mitigates this most recent ransomware:

  • Windows 7 / Windows Server 2008: KB4012212
  • Windows 8 / Windows Server 2012: KB4012217, KB4015551, KB4019216
  • Windows 10 / Windows Server 2012 R2: KB4012216, KB4015550, KB4019215
  • Windows Server 2016: KB4013429, KB4019472, KB4015217, KB4015438, KB4016635

On a Windows  7 system, we would use:

Get-hotfix –id KB4012212

You can also execute the command against remote computers by using the –ComputerName parameter

Get-hotfix –id KB4012212 –computername Jon-Desktop

You can put a list of computer names in a variable and then pull all of those hotfix installation reports with a couple lines of PowerShell scripting:

$computerstocheck = @(“JON-NUC”,”SERVER”)

ForEach ($computer in $computerstocheck)  {

Get-Hotfix –id KB4012212 –ComputerName $computer


Here is a sample of the output from that particular script run on my deployment:

Two – Disabling vulnerable versions of SMB with PowerShell

If you need a “too long; didn’t read” version of this next section, consider this: “you’re stupid if you are still running SMB version 1. Turn it off.”

That is harsh, but it is appropriately so. SMB 1 is decades old file sharing technology that has been vastly improved, both in terms of feature set, performance, and security, by later versions of SMB. There is no practical reason for enterprises running any modern version of Windows to be running SMB1. While some Windows alternatives like Linux and SAMBA emulate SMB1, on a Windows system from the last decade or more, SMB1 gives you nothing and takes away significantly from your overall security posture. SMB1, in fact, is one of the key ways that the Petya and WannaCry malware exploited vulnerable systems. (The patch fixed the vulnerability but SMB1 was essentially the channel, or the vehicle, the vulnerability used.)

On Windows 8, Windows 8.1, and Windows Server 2012 and Windows Server 2012 R2, there is a built in cmdlet that deals with the SMB versions present and in operation on any given machine. It is called Set-SMBServerConfiguration. You probably will not need to use this very often, so I will just give you the command you need to turn SMB1 off:

Set-SmbServerConfiguration -EnableSMB1Protocol $false

On those systems, the change is effective immediately. This will kill WannaCry and Petya in their footsteps, although deploying the patch I mentioned in the previous section is still highly recommended.

Earlier versions of Windows are a little more complicated. Windows XP did not have PowerShell built in and you have bigger problems than SMB1 if you are still running Windows XP in production, so I will start with Windows Vista in 2006. For Vista, Server 2008, Windows Server 2008 R2, and Windows 7, you will need to use PowerShell to change the properties of a Registry item. The following will get it done:

Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB1 -Type DWORD -Value 0 -Force

As with most Registry changes, you will need to reboot the affected boxes before the operating system will pick up the change. You can choose to push this PowerShell script out in a login script, or execute it remotely with PSExec, or even use your own software distribution system to make sure this runs. For that matter, you could even use Group Policy Preferences to make the change, but then you wouldn’t be using PowerShell!

Three – Monitoring the success or failure of Windows Server Backup attempts

One thing that helps secure your integrity when it comes to ransomware infections is the ability to recover from them. Obviously it would be great to never be infected by ransomware, but that is not always possible: users will be users. But if you can restore from backups within an hour or two and get everyone going, you look like a hero and your business has not lost much. The key here, however, is to have consistent backups, and the best way to make something consistent is to systematize it. How can we use PowerShell, then, to make sure our backup system is working as intended and more importantly to know when backups have failed?

The inspiration for this script came from Titus1024 over on Spiceworks [], though I’ve edited his script and improved it for clarity. What it does is grabs today’s date and stores it in a variable, grabs the backup status from the Get-WBSummary cmdlet and stores its output in a variable, and then gets the date of the last backup attempt, the last successful backup, all successful backups, and the last error message for an unsuccessful backup. Then it uses some comparison logic to fire off an e-mail message with the appropriate status.

A few things to note:

  • In Windows Server 2008 R2, you will need not only the Windows Server Backup role installed, but also the command line tools feature—that is what gets you the requisite PowerShell commands.
  • Before deploying the script into production, you will want to change the email from and to destinations as well as specifying a proper SMTP server through which you can transmit these outbound messages.
  • And also do not forget both closing curly braces; they are important and the script will not work without them.

$Date=Get-Date; $Date=$Date.AddDays(-1).ToShortDateString()
$ErrorMessage=Get-WBJob -Previous 1; $ErrorMessage=$ErrorDesc.ErrorDescription

Date: $TimeOfLastSuccessfulBackup
Backups Available: $BackupsAvailable

Last Backup: Failed
Date: $LastBackup
Reason: $ErrorMessage

Last Backup: Failed
Date: $LastBackup
Last Successful Backup: $TimeOfLastSuccessfulBackup
Reason: $ErrorMessage


if($ResultOfLastBackup -eq 0){

Send-MailMessage -To “” -From “” -Subject “Backup Successful – $ENV:COMPUTERNAME” -Body $SuccessfulBackupEmailMessageBody -SmtpServer
elseif($ResultOfLastBackup -ne 0 -or $TimeOfLastSuccessfulBackup -lt $Date){
if($TimeOfLastSuccessfulBackup -lt $Date){
Send-MailMessage -To “” -From “” -Subject “ALERT to a Failed Backup Attempt – $ENV:COMPUTERNAME” -Body $RecurringFailedBackupEmailMessageBody -SmtpServer
Send-MailMessage -To “” -From “” -Subject “ALERT to a Failed Backup Attempt – $ENV:COMPUTERNAME” -Body $FailedBackupEmailMessageBody -SmtpServer

Four – Monitor the membership of the Domain Administrators group for irregularities and changes

One of the key intrusion detection responsibilities you have as an administrator is to watch for privilege escalation attacks. As such, it makes sense to understand who all should be members of the Domain Admins group and then get updated if that list changes so you can make sure the modification is kosher. PowerShell can help us do this.

The first step is to understand what the baseline membership looks like. This command grabs that information:

Get-ADGroupMember -Server yourdomain.tld -Identity “Domain Admins”

From that list, we want to get the login IDs – a property known as the SAMAccountName – and then we want to flush that list out. We could export to text, but let’s instead use XML, which is a little more flexible to work with in case you want to expand out the powers of the script later. (Reading text back in can be done, but manipulating a bunch of strings is a lot tougher.)

Get-ADGroupMember -Server yourdomain.tld -Identity “Domain Admins” |

Select-Object -ExpandProperty samaccountname |

Export-Clixml -Path ‘C:\powershell\domainadminbaseline.xml’

Now, let’s declare some variables: today’s date, the path to that baseline XML and its file hash , the path to a new XML file that gets created whenever you will run this script, and a placeholder variable.

$HashOfBaselineAdmins = Get-FileHash -Path ‘c:\powershell\domainadminbaseline.xml’ |

Select-Object -expandProperty Hash

$Date = Get-Date

$PathToCurrentAdmins = ‘c:\powershell\domainadmintest.xml’

$Delta = ”

Next, run the Get-ADGroupMember command again to get the current results of the group membership.

Get-ADGroupMember -Server yourdomain.tld -Identity ‘Domain Admins’ |

Select-Object -ExpandProperty samaccountname |

Export-Clixml -Path $PathToCurrentAdmins -Force

Then, let’s get the hash of that new file and store it in a variable we can use for comparison.

$HashOfCurrentAdmins = Get-FileHash -Path $PathToCurrentAdmins | Select-Object -expandProperty Hash

Now we run some comparisons.

If ($HashOfCurrentAdmins -ne $HashOfBaselineAdmins){

$Delta = ‘Yes’

$WriteChangesMessage = ‘Domain Admins membership change noted on: ‘ + $date

$WriteChangesMessage | Out-File -FilePath ‘C:\powershell\changenoted.txt’ -Append -Force

} else {


$Delta = ‘No’

$WriteNoChangesMessage = ‘Domain Admins membership is the same as it was as of: ‘ + $Date

$WriteNoChangesMessage | Out-File -FilePath ‘C:\powershell\nochange.txt’ -Append -Force


Now we can add some logic that if that delta variable is  Yes, a mail message should be created and sent to you.

If ($Change -eq ‘Yes’) {

Send-MailMessage -From -to -Subject ‘Domain Admins group membership change detected’ -Body ‘A change in the membership of the Domain Admins group has been noted.’ -Attachments $PathToCurrentAdmins


Hat tip to David Hall [] for his work here, which I’ve again edited and clarified.

Five – Make PowerShell instruct your computer to talk to you

This trick is a little less, well, technical, than the other four tips I’ve covered in this piece, but it has a wide range of applications. Here I’ll show you the three lines of PowerShell code needed to make your computer recite something to you.

First, you need to add the prerequisite ingredients:

Add-Type –AssemblyName System.Speech

Next, declare a variable which will essentially create a .NET object whose function you will call later. This just saves you some typing; consider it like a shortcut. We will call the variable $talk.

$talk = New-Object –TypeName System.Speech.Synthesis.SpeechSynthesizer

Now, to get something to come out of your speakers, you just call the Speak property of your $talk .NET object.

$talk.Speak(‘Now is the time for all good men to come to the aid of their country.’)

The great thing about this trick is that you can add it basically into any script you already have so that you can be alerted audibly if something is off, or when a lengthy compare process is done, or you want to announce something to your users (stick this in a login script, for example). I might choose to include an audible alert to announce that membership in my domain admins group has changed—see the previous example—or I might want to list a group of computers that does not have a critical patch installed. The sky is really the limit here, and all you need to add this functionality is essentially these three lines of PowerShell code.

The Role of Agents in a Software Defined Network

An edited version of this story ran on

In this article, I want to talk about network agents—what some in the industry refer to as the future of the software defined network. Agents are responsible for a great deal of flexibility and control, and the work they do can vastly impact how responsive and agile a software defined network can be. Let us dig in.

What are agents?

In almost all software defined networks, agents are the tool by which network applications expose their abilities for network controllers to modify their configuration at any given time. Network agents can live on the software defined network controller itself, providing a mechanism for the controller to talk to various applications through the controller’s northbound interface. (These northbound interfaces are generally output only—they only communicate outward to the individual SDN-aware applications.) Network agents can also live on different network elements, comprising a data path. All of these elements work together to forwarding traffic through the datapath’s external interfaces or process or terminate traffic within the element itself.


Where this all gets interesting is here: one or more of these datapaths (an agent and an engine) may live inside one physical network element—an “bucket” of welded-together communications resources, which the SDN sees and manages as a unit. But it goes further. A datapath may also be defined across multiple physical network elements. This logical datapath doesn’t care how datapaths map to actual physical assets, how those physical resources are managed or how they are abstracted away, how all of this is virtualized or how it all interrelates and interoperates, and more. It’s a completely different thing than physical wires, ports, and switches. The agent itself is responsible for communicating with the SDN controller about what the datapath is supposed to represent and how its engine is supposed to behave, and the datapath network agents do this communication across the network controller’s southbound interface.

How are network agents deployed in production SDNs?

In some networks, administrators install virtual network agents on every hypervisor host (in this scenario, each hypervisor host is a network element). The virtual network agent on each host then directs traffic toward the virtual switch. If that virtual switch recognizes that particular flow of traffic and is able to match it with a prescribed action, then it can adjust the configuration of the virtual machines on that host so that the flow of traffic exits through the host’s physical network interface card. If the virtual switch doesn’t recognize the flow, it sends a mapping request back to the agent, which queries a mapping service in the network controller so it can figure out where that traffic is supposed to flow.


In other scenarios, network agents are key to implementing virtual functions on the network. Workloads like load balancers, firewalls, threat monitors, intrusion detection, packet capture and packet and traffic forwarding, and more can all be implemented by various network agents residing in different network elements. The controller can deploy, activate, deactivate, and redeploy these agents as needed whenever traffic flows in one direction or another, and large scale SDNs can deploy multiple copies of these objects for multitenant scenarios or to respond to a breach, a distributed denial of service attack, an unusually large load during a spiky peak period, or other one time occurrence.

Putting it all together

The important element to remember when it comes to agents is actually what distinguishes a software defined network from a physical network: the fact that the physical components, the discrete switches and patch cables and ports and whatnot are completely abstracted away and the only networking we care about—and the networks to which these network agents serve and function—are the traffic “flows” created by applications.


Imagine how this would apply to human travel. SDNs in that context are essentially the difference between worrying about interstates and side roads versus the concept of traveling from Los Angeles to San Francisco. SDN cares out the route, the flow, the purpose of the traffic and its outcome, rather than concerning one’s self with which exits to take off the interstate, where to turn right, what to do if there is a traffic backup, and the like. By focusing on the flows, the need of packets and data to get from one application to another, we get the concepts of agents, the bits that carry out the instructions from the control plane and translate those into action on the data plane.


In conclusion, agents are key to the SDN experience and perform the vital role of translating instructions from the control plane to the data plane.

Exploring the Chocolatey Package Manager for Windows

Note: An edited version of this article appeared on on November 13, 2018.

I’ve administered both Windows and Linux systems for close to two decades now, and honestly while Linux is a fantastic operating system and very appropriate in many respects for many applications, I’ve long preferred Windows for its generally better ease of use and polish. But that doesn’t mean Linux hasn’t had features I’ve lovingly pined for and miss on Windows – and a package management solution is one of them. Luckily, there are a couple of solutions to this, and best of all, both are open source and free. Read on for more.

The Premise Behind Package Management Systems

Linux distributions have had package management options for a while. You probably have heard of Red Hat’s RPM (Red Hat Package Management) format, Debian Linux’s apt-get, and then the new yum package manager that seems to be infiltrating a lot of distributions these days. At their core, these package management systems seek to achieve the same objective: analyze a system, determine what packages are necessary to run whatever software the user is requesting, find the latest compatible version of all of the packages, and install them in the correct order, ensuring they get laid down on the system successfully and that, after the 117 dependencies install, your text editor of choice is ready to run on your target system. I kid, but only a little bit.

Imagine bringing this over to Windows. Imagine the scenario: you are moving to a new system and setting it up properly, exactly how you like it. In the process, you are trying to find the latest version of Notepad+, for example, or any other reasonable popular utility. As it stands now, out of the box, you would Google for the site, find the download link, skip past all of the “featured offers” and near malware that most sites like to bundle with their downloads, and then run the installer. After that, you might even discover you downloaded a 64-bit version when you installed a 32-bit version of Windows. Or maybe you found an old download link, and there are two newer versions out there. That whole sequence is not exactly rocket science, but it is trying.

Imagine, instead, that you could simply say

choco install googlechrome

from a PowerShell command prompt and you would get:

…which would be followed by a completely functional installation of Google Chrome. That would save a lot of time, right?

And what if you had software installed like Google Chrome and then wanted to upgrade it? What if you could use a command like

Choco upgrade googlechrome

…and get an instant upgrade?

That is the power of package management, and that is what the Chocolatey package manager brings to Windows: a greatly expanding selection of carefully curated and maintained software packages that can be brought down and installed on your system with a simple three word command. As of this writing, there are 3,958 community maintained packages, and you can browse and search among them on the web at

Where Chocolatey really comes in and shines is in the process of setting up and deploying new machines. If you have a fairly standard set of tools – Office 2013 or the 365 version of Office ProPlus, along with some other utilities like 7Zip, your web browser of choice like Mozilla Firefox or Google Chrome, and a few others, then you can absolutely script the setup of a new machine. Just deploy Windows through whatever method you care to use, and then once you have completed the installation and are at an administrative desktop, simply kick off a script that installs Chocolatey and then calls all of your software. Now you can get 70-90% of your software installs automated without having to do a bunch of imaging and packaging yourself, and all of the installations are done in a consistent, repeatable, reproducible way—another benefit of scripting in general.

Understanding the Pieces of the Chocolatey Puzzle

First, let us understand how all of the pieces fit together in this package management puzzle.

  • Chocolatey is a package manager that works with Windows – specifically, that is any version of Windows 7 or later that also has PowerShell installed. This is the vast majority of clients in production environments today. It uses scripts, along with a specific software package format (more on that in the next bullet), to install applications on your system.
  • NuGet is that specific software package format. It has previously been used by Windows software developers to install software dependencies for their own development projects. These were typically libraries, bootstrap utilities, and more that existed as complete packages out on the Internet, ready to be re-used. NuGet was simply an easy way to get those dependencies put in the right place within individual products.
  • PowerShell is the command engine that makes the whole thing tick. It functions as the scripting language and execution environment for all of Chocolatey. Chocolatey uses PowerShell to grab software, packaged in NuGet format, to install applications for your entire system, not just development projects.

To get started on a test system, use one command, straight from the regular command prompt (be sure you have administrative rights to do this):

@powershell -NoProfile -ExecutionPolicy Bypass -Command “iex ((new-object net.webclient).DownloadString(‘’))” && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

This one line of PowerShell actually does quite a few things, as you might expect. Let us walk through them individually.

  • It supersedes any custom profiles you have configured so as to ensure a full namespace is available to this command.
  • It sets the execution policy for just this one command to Unrestricted so that scripts that are downloaded from the Internet (in the case of this command, that is can be executed and not be treated as potentially malicious).
  • It downloads that .ps1 script from the Chocolatey website, which is a preconfigured set of instructions that PowerShell can use to install the Chocolatey system on your local machine.
  • It also sets a PATH entry to the default binary folder for the Chocolatey install, so that you do not have to enter the full path to the Chocolatey commands every time you would like to do any package management tasks. Instead you can just enter “choco” and then whatever you need, and Windows and PowerShell will know where to find it.

The Chocolatey installation process requires the .NET Framework version 4.0 and will attempt to install it automatically as part of that PowerShell script. I have set this up on Windows 7 and Windows 8.1 machines and that automatic installation of .NET was totally successful, although some administrators have a deep rooted aversion to installing multiple versions of the .NET Framework on systems due to potential application compatibility issues and the attendant security patching that is required for each respective version. However, this is an all or nothing proposition, and I think the benefits of Chocolatey outweigh the negatives of another framework version deployed.

Chocolatey in Action

Chocolatey is essentially an automated deployment wrapper. It does not intercept installations or somehow modify the setup process of an app. Rather, it automates the downloading of a setup file or package and then its execution, while turning off any sort of screen communication from the app (a silent install).  Here is an explanation direct from Chocolatey that goes into a little further detail:

“Chocolatey is a software management tool that is also a package manager. It functions fantastically well when the software is all included in the package and it doesn’t make use of native installers. However to approach the Windows ecosystem a package manager also needs to know how to manage actual software installations, thus why Chocolatey does that as well. For publicly available packages, copyright keeps from having binaries embedded in packages, so Chocolatey is able to download from distribution points and checksum those binaries.”

Some tips:

  • The command cinst works instead of choco install to save you some keystrokes and avoid carpal tunnel syndrome. So choco install googlechrome could also be cinst googlechrome.
  • Choco uninstall packagename removes a package from your system. It only removes the Chocolatey installed instance, so if for example you have a previous Git installation, then install Git from Chocolatey, and use choco uninstall git to uninstall one of your Git deployments, it will remove the Chocolatey installed instance.
  • Want to search for packages but do not want to browse the web? This is common on new server installs. Use choco search packagename to search the Chocolately package feed.
  • The command choco outdated will give you a list of all of the packages on your system that have a newer version available from the repository.

The Downsides of Chocolatey

As with every tool, there are negatives. Here are the most important ones for Chocolatey.

  • There is a malware risk to Chocolatey, however slight. Unless you run your own packaging team and set up Chocolatey’s PowerShell scripts to only retrieve packages from your own private repository full of packages you have vetted and trust, you will not be able to remove from your security mind the idea that you are downloading packages from a third party source. Those packages could well have malware in them, put there either on purpose by a nefarious actor in the contributor and maintenance team or, much more likely, the Chocolatey repository was hacked and malware payloads were inserted into the packages. To my knowledge and as of this writing, this type of breach has not happened to Chocolatey. But “has not” is not the same thing as “could not” or “will not,” and so there will always be a risk. On the flip side, Chocolatey is very popular and most of the package maintainers are very diligent about their work. Since the whole shebang is open sourced, the “many eyes” theorem means that problems and breaches would be discovered quickly and mitigated quickly, and the resulting reporting would be transparent. Caveat emptor.
  • Package maintenance is not always quick. Remember, Chocolatey depends on a team of volunteer contributors to package up applications. When new versions of the core applications are released, it is not an immediate process to package up the upgrade and make it available in the Chocolatey repository. For more popular applications like web browsers and some utilities, this is not a big issue—for one that software generally has the ability to update itself, making Chocolatey’s upgrade function a moot point; but the more popular the application is, the more active the Chocolatey package maintaining team for that application generally is. The wait for more obscure packages could be quite a bit longer, or packages could be left abandoned after several years.
  • Sometimes install locations get screwed up and there’s no way to track it. Because Windows lets software developers lay their bits down on users’ drives pretty much wherever they please, you wind up in situations where Chocolatey wants to put a particular piece of software in one location but the GUI installer you would download from the Web wants to put the software in another location. Herein lies the problem: if you install something outside of Chocolatey, especially if that software installs itself in a directory or folder Chocolatey does not know about, then Chocolately will not think you have that software installed—so it will let you go choco install thatpieceofsoftware and suddenly you have two installations of the same product on the same system. Sometimes that is not a big deal, whereas in other situations, it cripples the software.

For Windows 10, There is PackageManagement

Part of the innovating happening in Windows 10 and Windows Server 2016 is the Windows Subsystem for Linux, or WSL. This is essentially a port of Ubuntu Linux and other popular Linux distributions to Windows in a way that runs those Linux distributions as “layers” or subsystems underneath the regular Windows 10 user experience. Regular Linux binaries work and you can even install the X Windowing System and get separate graphical shells happening. (Who would have thought the year of the Linux desktop would actually be brought to us courtesy of Microsoft?)

This means that the plumbing is already inside Windows 10 to be able to provide a native package manager that works with PowerShell and Linux binaries, opening up a second entire ecosystem of applications to run on Windows 10 machines. That package manager is called PackageManagement, creatively, and it works with Chocolatey repositories, too. In fact, it is more of a package manager manager, because it works with multiple repositories and brings all of their capabilities and inventory together with a single tool.

To verify that PackageManagement is set up on your system, open a PowerShell prompt with administrative credentials and then type in the following command:

Get-Command -Module PackageManagement

Then, take a look at the universe of commands you have available to you.

To find out what repositories work, then call the following command:


You will probably find that only the regular PowerShell gallery is there. We can add the entire Chocolatey repository with one single command:

Get-PackageProvider -Name Chocolatey

To use the Chocolatey source repository by default, use this command:

Set-PackageSource -Name chocolatey

Now let us try to add some software. We can continue to use Chrome as an example. From the Get-Command example above, we saw that there is a Find-Package command which ought to find a package in a repository. Let’s search for Chrome:

Find-package –name Chrome

In the results, you will see quite a few responses, all of them packages of Chrome that are available in Chocolatey repositories. You can install any one of them by using the install-package command:

Install-Package chrome

Unfortunately, one of the really nice features of raw Chocolatey, the upgrade command, is not available with PackageManagement. Perhaps one day this will be available, but for now, this is only useful to install or remove packages. And again, PackageManagement (which, for future reference, was codenamed OneGet during Windows 10’s initial development) is only available for Windows 10 and now Windows Server 2016, because it is dependent on the Windows Subsystem for Linux, which will not be backported to earlier versions of Windows. It is also important to note that OneGet can co-exist with Chocolatey so you can use whichever option makes the most sense. It is a very nice tool to have in the arsenal and one that especially for power users and developers can make quick work out of application installation and maintenance.

The Last Word

I suppose the best way to sum up Chocolatey is: it’s one of those tools where if you need it, you know as soon as you see it that you need it, and you want it right now. I’ve long searched for a lightweight tool (read: NOT System Center) to script software installations and make it easier to stand up development and test environments with the right programs and utilities. Bonus points that Chocolatey uses PowerShell to get its work done. Check it out now.

A First Look at Project Honolulu, the new Windows Server Management Experience

Note: an edited version of this story ran on on November 2, 2017.

I’ve been on the PowerShell train for years now—so much so that I wrote a book on how to learn PowerShell, because to my mind PowerShell knowledge is required if you work in Windows administration in any reasonable capacity in this day and age. But PowerShell is not always the best tool for the job, and options are always good. Microsoft’s graphical user interface (GUI) tools have become somewhat long in the tooth especially over the last three to four years as the company invested a lot of time and energy into expanding the universe of things PowerShell commands could accomplish.

Traditional administrators saw all of this happening and thought to themselves, what of Windows itself? After all, if you want command line, you can go with Linux—Windows was supposed to be point and click all along. To this group, Microsoft says, fear not: we now have something superior to the in-the-box GUI tools you know well. Enter the new Server Management Experience, codenamed Project Honolulu. It can manage Windows Server 2012, 2012 R2, and 2016 and future versions all through a web browser (currently Edge and Google Chrome). It can even handle the free Microsoft Hyper-V Server, making this a no brainer way to get a free hypervisor deployed in environments that don’t really need a full fledged copy of Windows Server without trying to manage through Hyper-V Server’s cryptic command line interface.

Let’s take a look at how Honolulu works, how it’s built, what it can do, and perhaps most important, what is isn’t.

Project Honolulu

There are a lot of different tools you need to use to manage servers with the in the box utilities you get today, and Project Honolulu’s main mission is to get all of these pulled together in one place. All of the tools’ functionality are integrated on the left side of the screen—Hyper-V tools, disk management, file server management, and more. An intuitive, HTML5 based touch screen compatible interface lets you browse around and carry out just about any task that the previous tools would let you complete, just all from a “single pane of glass,” to use the preferred industry term.

The great news is that this is a really lightweight install. If you want to run it on a server, it does not need to be a dedicated machine, and you can also deploy it onto a management workstation or laptop. You run a single MSI installer of about 30 megabytes, with no dependencies, and you can run it on any Windows 10 or Windows Server 2016 machine. It’s literally a few Next, Next, Next clicks in an installation wizard and then in about 30 seconds, the operation is complete. Then just type in a server name, Honolulu will find it, and bang, you are managing your machine remotely.

Some notes on behavior:

  • If you install Honolulu on a Windows 10 machine, you essentially get a browser-based single app that you can use to manage any number of remote servers. Honolulu will listen on port 6515 by default, although you can elect to change this.
  • If you install Honolulu on a Windows Server machine, it configures itself as a multi-user web app and any user can connect to it and customize their own configuration. You must specify the port that the service will use to answer requests, and you will need to either allow Honolulu to generate a self signed certificate or install an appropriate certificate on the server before installation and point the Honolulu installer to that certificate’s thumbprint.

Once your installation is complete, the next step is to add a machine to manage. On the main screen, under All Connections, click the Add link.

From there, you can add a single server, a cluster of servers, or a hyperconverged cluster of servers. (For what it’s worth, to manage a hyperconverged set of clusters, you must be running the new Windows Server Semi Annual Channel release, which counts out a lot of organizations at this point.) For our purposes, let’s just add a single server: we’ll select that, and type the server’s name, and then we are connected.

You can also have a list of servers in a text file, one per line, and then direct Honolulu to import those. Just click the Import Servers link and point Honolulu to that text file.

Perhaps the biggest point in favor of Project Honolulu is that it no longer requires you to use the awful Server Manager app that was introduced in Windows Server 2012. At first blush, I think we were all optimistic that that app would work better at managing multiple servers and making common administrative tasks easier, but most of us have discovered that the “new” Server Manager is simply a confusing mess. Now that a suitable replacement is around, we can banish Server Manager.

What else does Honolulu replace? The list as it currently stands:

  • Displaying resources like CPU, memory, and disk and their related utilization
  • Managing certificates, including installing new ones and managing expired and expiring certificates
  • Viewing events from event logs
  • Managing, uploading, and downloading files through File Viewer
  • Turning the Windows Firewall on and off and opening and closing ports
  • Configuring Local Users and Groups, including adding and deleting both
  • Network Settings, including IPv6 and IPv4 settings, network names, domain memberships, and more
  • Managing processes, including killing them and creating Process Dumps
  • Viewing and editing the Registry
  • Managing Windows Services, including viewing their current statuses, starting, and stopping them
  • Installing and removing Roles & Features a la Server Manager
  • Managing Hyper-V virtual machines and virtual switches
  • Managing disks and volumes, including creating, initializing, and setting drive letters
  • Managing Windows Update

You can easily imagine a scenario where you have ten, 15, 20 different servers all under your purview. You might even want to bring up a new system, in which case you lay down a copy of Windows Server on it, get it connected to the network, and then add it to the Honolulu interface. At that point, you can use Honolulu to configure IP addressing or change the system name, add disks or initialize disks you have plugged in, kill roles or add new roles like file server services or container services. Once that new system is up and you have 21 servers to manage, you can then see them all in one place. Is there, say, an errant task pegging a CPU higher? Just click into it from the screen, look at a process view, and end the troublesome task. Need to check if an update is installed? Click into Windows Update view, or to prevent a patch from installing by entering a new Registry key, just click the Registry node.

One of the cooler bits is how you can essentially replace the staid Hyper-V Manager tool with Honolulu.

It is a very convenient tool with a very easy, intuitive interface. Click around and you will find that it largely just makes sense.

Is This Azure Server Management Tools?

What happened to Azure Server Management Tools? The idea behind the Azure SMT product, which was discontinued in June 2017, was access and management from anywhere on any platform, with the fact that it was hosted in Azure meaning it could be updated and improved continuously. However, according to Microsoft, the top customer feedback from the toolkit was that users had environments that were not connected to the raw Internet (how can you then manage those types of deployments over the Internet?), and additionally some customers needed fully deployed tools in their local environments. Partners didn’t like SMT because it only was tied to Azure and not other public clouds, and sometimes a dependency on any cloud, Azure or otherwise, was not a natural fit. Additionally, the top user feedback request was basically to make SMT available on premises without an Internet connection. That is exactly what Project Honolulu is: you can manage from anywhere, including integrating in the future with Azure, from any platform since it is a browser based solution, that starts with core tools and ships independently (not in the OS image but as a separate download) which makes revisions possible on a much faster cadence.

Project Honolulu’s Architecture

Honolulu as its core is a lightweight web server and gateway. The web server does not depend on IIS; rather it uses a self-hosted stack that leverages HTTPS. The gateway is the piece that lets you fan out to manage remote servers using PowerShell and Windows Management Instrumentation over WinRM, the remote management protocol. Crucially this means that there is no agent infrastructure for Honolulu so nothing additional is required on the servers you want to manage; all of this instrumentation technology is already built into the operating system and is mostly standards based at that. (For Windows Server 2012 and Windows Server 2012 R2, you will need to upgrade the version of the Windows Management Framework to 5.0 or higher; the current version, 5.1, is available here [].)

What Project Honolulu is Not

Honolulu is great and off to a promising start, but it is important to understand its limitations.

First, Honolulu does not replace any functionality covered in the following in the box tools (list courtesy of Microsoft):

  • AD Administrative Center
  • AD Domains and Trusts
  • AD Module for Windows PowerShell
  • AD Site and Services
  • AD Users and Computers
  • ADSI Edit
  • Cluster Aware Updating
  • Component Services
  • DFS Management
  • DHCP
  • DNS
  • Failover Cluster Manager
  • File Server Resource Manager
  • Group Policy Management
  • iSCSI initiator
  • Network Load Balancing Manager
  • Performance Monitor
  • Print Management
  • Remote Access management
  • Routing and Remote Access
  • Shielding Data File Wizard
  • Task Scheduler
  • Volume Activation Tools
  • Windows Server Update Services

That list could very well change as development on the project continues, although some of these tools lend themselves more to remote management than others.

Second, Honolulu is not a finished product. It is in technical preview, which means anything and everything could change—though it probably won’t. The code is in pretty good shape for a preview product and is suitable for use in production, although Microsoft will not admit that nor support you if you do. But at any time features may be removed, added, changed, moved around, and so on. A final release is expected in the not-too-distant future, and frequent updates are expected since the utility can be delivered “out of band.”

Third, Project Honolulu is not a replacement for a third party systems management suite. It is designed for relatively lightweight server management and monitoring. It does not support older Windows releases, nor does it handle client management or software distribution. It also does a cursory job of monitoring but does not orchestrate an alerting workflow or any type of automated response, both of which are necessary to have in enterprise environments. Project Honolulu is available at no additional charge with a Windows license, which is really nice, but it does not purport to solve all of the issues that you would need a product like System Center Configuration Manager and Operations Manager for. It is a convenient add-on.

The Last Word

The GUI is not dead! There is no denying that however useful PowerShell is in a variety of applications, there remain scenarios where a visual approach is the right way to go. It’s very refreshing to see Microsoft embracing both types of tools and really investing in a useful, intuitive, and best of all free (with a license) way to manage more recent versions of Windows Server. As the tool grows to integrate resources in Azure as well as extensions from third parties, this is sure to be a useful set of bits to have around. Recommended.

Download Project Honolulu here:

10 Free SharePoint Tools

An edited version of this article ran on on September 20, 2017. Credit: Computerworld

The SharePoint software vendor ecosystem has produced many free tools that help you administer and configure a SharePoint farm or Office 365 deployment on a day-to-day basis. The vendors would, of course, love to have you upgrade to their for-pay software products, but until you do there is much utility in these free tools. Here are ten that many administrators find extremely useful.

1. Marco Wiedemeyer’s SPDeployment command line tool

Many companies develop solutions that live inside SharePoint, but those SharePoint developers have a hard time deploying those solutions to the right spots within the SharePoint hosting infrastructure, whether that is on premises or up in Office 365. Who wants to keep all of those details straight every time you make a change to a SharePoint Solution? Developer Marco Wiedemeyer has developed a tool that developers can run from the command line that reads a standard JavaScript Object Notation (JSON) file and automatically puts files where they should be and marks properties as they need to be. It handles the credentials of logging into SharePoint as well. You can even use it with multiple sites and environments and trigger deployments as granularly as your developers would need to. It gets installed via the NuGet Package Manager (NPM) and works right from a command console. Hosted on Github. Free.

2. The SharePoint Online Management Shell

If you have worked with Microsoft server products for any length of time in the past few years, you know that PowerShell is the way to get things done from an administrative perspective. The SharePoint Online Management Shell is a preconfigured PowerShell environment that has called all of the SharePoint Online (Office 365) cmdlets into one safe space; you can do basically anything from here, from creating content packages to migrate file share data to SharePoint Online to creating new document libraries to turning on and off external access to certain SharePoint sites. If you have even the slightest remit to manage Office 365, then you should grab this shell—it is a virtual certainty that having it will make your life easier. Be sure to right-click it after installation and run it as administrator or essentially nothing will work. Runs on your local machine. Free.

3. Amrein Engineering Free Microsoft SharePoint Web Parts

Web parts have been around almost as long as the SharePoint product itself, but they have come in and out of “SharePoint fashion” as the product has matured over the years. Still there are many tasks for which a web part—a pluggable component designed to be run within SharePoint—is the best tool for the job. SharePoint 2016 comes with several built in, but a groupware firm has developed around seventy web parts that do everything from read Exchange conference room calendars to track individual stocks to perform overall task rollups across a given team. While your SharePoint developers can build complex solutions that ride atop the server, your users can grab these web parts and build simple pages and project sites themselves. Some of the 70 web parts are free, but all come with evaluation periods, and they are easy to license right from the page.

4. ManageEngine’s Free SharePoint Health Monitor Tool

If you’ve not invested in a lot of systems monitoring tools, or you have a smaller SharePoint deployment, you might want a lightweight tool that gives you just an overall rollup of your SharePoint farm’s health status at a glance. The ManageEngine Free SharePoint Health Monitor fits this bill nicely, giving you a convenient dashboard view where you can see details about the CPU, memory and disk space usage for each server running SharePoint.

Then you can drill down into the SharePoint workload itself and see the response time, service status, Web server (Internet Information Services) process details, and even SQL Server details like free pages, cache memory and buffer cache hit ratio. While this tool won’t help you with Office 365 deployments, and it does not appear to be supported for SharePoint 2016 installations, it does indeed work with 2007, 2010, and 2013, which are still widely used. Free; runs locally.

5. Visual Studio Community Edition 2017

In a land long ago and far away, SharePoint Designer was the preferred tool for non-developers to use to reformat, re-scape, and develop simple SharePoint solutions. Unfortunately, SharePoint Designer is no longer supported and only works with SharePoint 2013 and below. The tool of choice now is the surprisingly good and free Visual Studio Community Edition with the Office Developer Tools extension. The community edition is the free version of Microsoft’s very capable integrated developer environment (IDE), and the Office Developer Tools plug in lights up IntelliSense and debugging capabilities that let you run solutions right on the SharePoint Server itself, remotely in Office 365, or in an Office web app. This tool works with essentially all versions of SharePoint no matter where they are hosted. Free; runs locally.

6. Office365Monitor

For those shops with significant deployments in Office 365, it can be really useful to have an eye on how the service is performing. Microsoft has promised at various points over the years more insight into the health of the service overall as well as its individual components, but we frequently see events that do not ever make it to a health dashboard. In the meantime, users blow up your phones asking what’s going on and where their files are. Ex-Microsoft employee Steve Peschka created Office365Monitor as a web service to gain deeper insight into each individual component of Office 365 and its uptime. You plug in the name of your tenant and the tool basically does the rest. There is a generous 90-day free trial and after that it is so inexpensive as to be effectively free. Web service; runs in the cloud; 90-day free trial and then starting from $19 per month.

7. Veeam Explorer for Microsoft SharePoint

Veeam Explorer is basically Windows Explorer (or File Explorer in Windows 10, or Finder on the Mac OS X platform) for SharePoint. It lets you browse the database graphically, use full text search to find documents and items, restore individual items as well as their permissions if they have been backed up, export recovered items back into SharePoint directly or as e-mail attachments, and more.  It is also included in Veeam Backup Free Edition and can be used in conjunction with Veeam Endpoint Backup FREE, which makes this little tool extraordinarily useful. This works with on premises SharePoint 2010, 2013, and 2016 in all editions, but it does not work with Office 365. Free with backup product; standalone 30 day free trial; runs locally.

8. Veeam Backup Free Edition 9.5

Veeam has another really useful tool for those shops with investments in on premises servers. Sometimes your backup solution isn’t aware of SharePoint specifically, or maybe your backup just grabs virtual machines and copies them without doing anything intelligent on the processing side. Veeam’s free backup product is really quite good—I use it myself in my Hyper-V lab—and works with both Hyper-V and VMware. : Picture your SharePoint VM farm: wouldn’t it be nice to clone, copy, export and manage those VMs? Sometimes wouldn’t it be useful to peek inside the VM to restore individual application items? Veeam Backup lets you do this on an unlimited number of ESXi and Hyper-V hosts or VMs. It is totally free and thus a great tool to have in your arsenal as part of a layered SharePoint on premises backup strategy. Free; runs locally.

9. Refactored SharePoint SUSHI

SharePoint SUSHI was an open source project hosted on CodePlex that essentially took the most common administrative tasks and put them in one tool. SharePoint SUSHI is a powerful, user-friendly utility enabling you to accomplish common administrative tasks. You can think of SUSHI as a Swiss army knife for SharePoint. While the original version that supported only SharePoint 2007 languishes unloved on the deprecated CodePlex platform, Ivan Sanders, a SharePoint MCT, MCTS, MCITP, MCSE has refactored the tool for use with SharePoint 2013. It is unclear if the tool works with SharePoint 2016, but it does not in any way interface with Office 365.

You can view the lists and sites any given user can access, which is really helpful for looking at effective permissions; upload user photos as profile images; back up and restore sites; apply a theme to a group of sites with one click and much more.

This is a visual studio solution that you download from Github and build yourself, or you can use a precompiled EXE that you can find on GitHub. Free; runs locally.

10. SharePoint Color Palette Tool

If you are not a web designer or artist, then coming up with aesthetically pleasing color palettes can be a real challenge. With SharePoint 2013, 2016, and now Office 365, branding is more possible than ever. Microsoft has a nice little tool to help you create polished, composed color choices. Free, runs locally.





Is Windows to Go a Good Solution for the International Airline Laptop Bans?

An edited version of this story ran on on August 8, 2017. Credit: Computerworld

Often Microsoft presents technological solutions to problems that only a tiny percentage of its customer base has. Windows to Go was just such a feature—a nice solution to a problem that was virtually non-existent back when it was first released in 2011. However, six years later, that non-existent problem could very well be widespread.

What is Windows to Go? It’s a way to take a Windows installation with you on a USB thumb drive. You pop that thumb drive into any computer, boot from the USB, and your personalized installation of Windows—with all of your applications and files and access to corporate resources—is there. When finished, shut down, unplug the USB thumb drive, and away you go. It’s essentially portable Windows.

Windows to Go becomes more attractive in a world that seems to find traveling with electronics to be a security threat. You probably recall the recent news of the ban on laptops from all flights entering the United States from both selected Middle Eastern countries, as well as, more recently, flights coming from Europe. While this ban was lifted, more stringent security protocols are reportedly being developed for both domestic and international flights.   We could soon be entering a world where laptops are either checked in the baggage hold at airports without fail or not brought on trips at all—or a world in which officers at ports of entry demand access to electronics for either cursory or in-depth examinations. Having a nice USB thumb drive tucked away somewhere could be a real asset.

Having laptops subject to examination, or possibly locked away outside of an employee’s purview, has obvious implications for enterprises around the world. Many organizations have security policies that prohibit employees from leaving their corporate laptops unattended. Many organizations do not, as a matter of policy, encrypt the local hard drives of laptops they issue to employees. (This is very obviously a mistake in today’s world, but that does not change the reality of the situation.) Many organizations send field workers into some very remote and insecure areas of the world, often with real business assets and trade secrets stored in digital form on workers’ laptops.

These types of security protocols make it more likely that you will be separated from your laptop. Your business travelers have to put notebooks with company secrets somewhere else not within their direct control and they have virtually no say what happens to those notebooks when they are outside your travelers’ fields of vision. For most enterprises, this is far too much risk.

But that risk is a lot lower when you take Windows with you on a thumb drive and worry about the actual PC you use whenever you get to where you are going. Let’s learn a little more about Windows to Go.

What is Windows to Go?

Windows to Go was introduced in the Windows 8 release wave as an alternative to virtual desktop infrastructure: it is essentially a portable, entirely self-contained installation of Windows that you use on a USB thumb drive—that drive needs to be USB 3 in order to have the read, write and data transmission speeds necessary for a modern computer to run an operating system off of it. But what you end up with, after you configure it properly, is an entirely self-contained computer for a knowledge worker that is encrypted and fits in one’s pocket. You can pop it in your travel bag, in the car, even in your socks (if you are that type of person) and all you need to do is plug it into any reasonably modern PC, boot off the USB drive, and your OS, documents, wallpaper, personal settings, applications, and everything else is right there for you. This copy of the OS is managed through an IT department and thus it can have VPN software on it, or if you have configured DirectAccess, that copy of Windows can reach out over the Internet and retrieve its managed settings, Group Policy object configuration, and so on.

There are some key differences with Windows to Go, in its default configuration, as opposed to a similar copy of Windows installed on a regular fixed drive in a PC as you have come to expect:

  • The local drive in the computer on which Windows to Go is run is hidden by default. This keeps whatever crap is on the local system from seeping its way onto the Windows to Go USB drive as well as helps users properly save and retrieve documents to the USB stick. You can disable this functionality, but it is more secure to leave the hiding feature on.
  • Upon the first boot on a new Windows to Go target computer (that is, the “guest hardware” into which you plug the Windows to Go USB stick), a process goes through and identifies the right hardware drivers for the target system and enables and installs them. This process may reboot the computer several times, after which the boot process will proceed straight into Windows.
  • Windows to Go detects drive removal. Windows in this configuration will pause the whole computer if it detects the USB drive is gone and then will shut itself down after 60 seconds if the USB drive is not reinserted into the target machine. This is to prevent folks from using their copy of Windows to Go at, say, an airport kiosk and then quickly just removing the stick without shutting down the computer—a scenario in which bad actors could then access a logged in corporate desktop. With this feature, the whole computer shuts down rather than leave access open for others. If the USB drive is reinserted within 60 seconds, then operation continues as normal.
  • Access to the Windows Store is disabled by default, but it can be reenabled through a Group Policy object change.


Otherwise, Windows to Go behaves identically to Windows fully installed on a fixed computer. The added convenience is simply that you can unplug the stick and migrate it to any other device in the future.

Deploying Windows to Go

It is not much more work to deploy Windows to Go than it is to release images of any version of Windows these days—your current toolset like DISM and ImageX will work just fine. All you need is the correct USB drive hardware, a Windows Enterprise image, and a Windows Enterprise host computer to write and provision the Windows to Go image to the USB stuck. It is possible to scale this deployment process using some PowerShell scripts so that you can make multiple sticks at once, in case these new regulations have caught you off guard and you need a solution, like, yesterday. There is a very comprehensive guide to deploying Windows to Go USB sticks on TechNet, including these scripts, and I heartily recommend walking through the process so you get a feel for the steps needed to complete the provisioning. ]]

After the sticks are created, you just hand them out to your users and tell them to boot off of the USB. You can see where this will come in handy in these banned laptop scenarios—there is no ban on a USB thumb drive, so you have a couple of options:

  • Take a loaner laptop with you that has no operating system installed at all—in other words, a bare metal laptop. You can allow that to be checked according to the airline’s procedure. When you arrive at your final work destination, plug in your thumb drive, which has never left your possession, and carry on. Of course it could also have a simple installation of Linux or Windows on it; it really does not matter as you would never boot into it.
  • Use Windows to Go in a business center at a hotel or convention center. Since the computer reboots to boot into Windows to Go, you don’t have to be concerned with software keyloggers or other runtime based malware. Of course it is possible for a hardware keylogger to be installed on a keyboard so you must weigh your current acute need for computing access against the threat profile you and your business have identified.
  • Purchase burner equipment at your final destination and return with it or destroy it. You can pick up any cheap laptop at any office supply store and it would be sufficient to run Windows to Go. If you are going to a reasonably populated area, $200-300 can be invested in a cheap laptop into which you can then insert your bootable stick and be off to the races. You can then either bring the laptop home with you or dispose of it—for maximum security this is a good option.


There is currently a list of officially supported Windows to Go USB drives which you can find at the Microsoft website []. I can recommend the IronKey Workspace W300, W500, and W700 options in particular as I have hands on experience with those models, and they have additional security features like boot passwords and self destruction capabilities for hard core security buffs. However, you can use devices that are not officially certified and most likely they will work fine as long as they are USB 3 devices. In fact, one of the officially certified devices—the Kingston DataTraveler—is off of my recommended list because it became scorching hot in my tests after less than an hour of usage in a Windows to Go scenario.

Licensing Windows to Go

Of course the brilliance of this solution technically is obscured by the money grab that is Microsoft licensing, except given recent current events, businesses may have little choice but to pony up for the additional expense.

Windows to Go is part of the Software Assurance program, that bundle of additional benefits and license flexibility that you get by forking over about a 33-40% premium on top of the cost of the license in question. The benefits of SA differ depending on whether your license is for a consumer or a server operating system and also whether this is for server application software or business applications like Office.

For operating systems, Windows to Go is part of the Windows SA benefit package. But of course you also have to decide if you want to license per device or per user. If you are licensed per device with Windows SA, then you can use Windows to Go on any third party device while off site. If you license Windows SA on a per user basis, then you can use Windows to Go on any device. You can also with both methods use Windows to Go on a personally owned device, but not while you are on a corporate campus. (This has to do with roaming benefits, or the ability to take a copy of the software you use at work and put it on your home machine.)

The Last Word

Windows to Go may have been ahead of its time, but it is certainly a competent solution for organizations that have more than a few regular international travelers getting caught up in these recent laptop bans. The great thing about using Windows to Go in these solutions is that it maintains your security profile, is only minimally more inconvenient for your traveler, and is easy to retire if and when these bans are ever lifted. Give it a look.

Exploring SSH Key Rotation with Thycotic Secret Server

Everyone knows and should be aware of the huge security issues there are surrounding the Windows administrator account, and there is a ton of guidance on how to properly secure that particular account, how to avoid password compromises, and how to use alternatives. But there seems to be much less intense focus on securing privileged accounts on Linux, and especially the idea that SSH keys are much like passwords in their absolute need to be protected at all costs.

SSH keys start out the security race ahead of passwords because they require two parts that do not exist in the same location all the time—a private key, which is often protected by a passphrase, is compared with a public key, and cryptographic analysis is carried out to determine if a user is authenticated to a system. This avoids the wholesale compromise of credentials just by gaining access to a system, since all that system would have is the public keys for authorized users. The other half of the puzzle, those users’ private keys, does not exist on the system anywhere.

Unfortunately, out of convenience or perhaps at the time, sheer necessity, the same private keys are re-used across multiple machines. This might be to make it easier for developers and testers to connect to a farm of Linux or Unix machines before they are moved collectively into production, or it may be that a single administrator is responsible for all of them and feels that he can properly secure that one single, well-formulated private key. It may even be an artifact of cloning a bunch of new virtual machines from an existing “template” image, or a relic of being able to easily automate a bunch of actions across a number of different machines using a single private key.

But of course, there is more to it than just one unique individual private key per user per machine. Those keys ought to be rotated and changed out, just like passwords should. This is for a variety of reasons: first, systems that contain private keys can be compromised, or the passphrases that protect the private keys can be compromised. Especially as news breaks today that the WPA2 wireless encryption technology has been broken and unprotected resources behind a vulnerable access point could be compromised, it is more important than ever to never fully trust a static key, password, phrase, or anything else, and make sure that secret is changed regularly.

The process of rotating keys is simple, but carrying it out is definitely not easy. Essentially it is a four-part process: you need to generate new keys, install that key into the authorized_keys file on all of your machines, test that new key, and then remove the stale key from that same authorized_keys file.

Brave folks use Ansible to take care of system administration tasks like these in an automated way, but then you need to spend time thinking about playbooks and plays and trying to make all of those pieces play together nicely. That all works well enough, and for the smallest deployments with the most limited of budgets it is a reasonable solution. But what about when the powers that be want proof your Linux or Unix endpoints are correctly protected this way? What if you need to easily control who can access those keys from an administrative staffing perspective? You need a stronger tool, and the folks at Thycotic have a proposition: why not use software designed from the start to automate the protection of our most sensitive privileged accounts and let it take care of the dirty work for you?

Thycotic Secret Server to the Rescue

Enter their Secret Server product and specifically the SSH Key Management function. This program will generate new keys and rotate them out either on demand or on a previously determined schedule, control via a role-based access control scheme and robust permissions which users have access to which keys, and provide a complete audit trail of which keys were sent where and when and who used them to access which systems on what date and time. Cobbling that together with Ansible would be a lot tougher and not nearly as seamless.

Thycotic asked me to spend some time evaluating this aspect of Secret Server and share my thoughts on the product.

My objective: get SSH key rotation going among 25 different Ubuntu virtual machines I have running in Amazon Web Services as part of another project. I installed a trial version of Secret Server on a Windows Server 2012 R2 box and added Microsoft SQL Server 2014 Express at the prompting of the installer. After completing the setup wizard, which was reasonably simple (although I did have to close and restart it due to an HTTPS binding issue which it automatically fixed), I went to the console and popped my license information in and enabled the Remote Password Changing settings. Then, I set out to create a new secret in Secret Server. Reading the Quick Start guide, I went with the Unix Account (SSH Key Rotation) template. On the template screen, I entered a friendly name for an account on one of those 25 machines as well as its username and password. I uploaded the private key file in .PEM format and entered its passphrase. I clicked the button and then watched for the Last Heartbeat field to say “Success” with an associated timestamp – that told me I was ready to go. I also liked I could just launch Putty and get signed in with one click – very convenient.

After that, I went to the Remote Password Changing tab and clicked Change Password Remotely. I generated a random password and then clicked Generate New SSH Key to get a new key. I also clicked the Generate button next to the Next Private Key Passphrase field to get a new protective passphrase. I clicked Change at the bottom and that was it. The key was rotated.

I went ahead and added a few of the other machines I was working with on that project and it all worked the same way as the previous one – add the secret, kick off the change, be done. It was a little work to get it set up but now I have a tool where with, what, three clicks? Four clicks? I can rotate keys all from a single point of management.

Pretty neat tool.