1

Taking a new Windows Server 2012 installation, I need to get it fit for hosting and automation.

That means getting it ready for remote PowerShell and DSC, which means installing the latest version of the Windows Management Framework, and then configuring WinRM for HTTPS and Basic Authentication.

I've not really 'engineered' Windows since 2008, but it seems that solving this egg-chicken problem requires a mouse and a browser.

And yet a couple of non-GUI footprints of Windows Server exist today, so what's the quick solution to getting these basics setup (at a command line) so that I can move on to automating the more advanced configuration of the host?

It kinda strikes me that there should be a single CmdLet in-the-box to get this fundamental stuff up and going.

Is there?

  • 1
    "Is there?" No, there is not a magic 'do what I mean' cmdlet. – jscott Sep 2 '16 at 16:06
  • As a programmer building apps for major global brands, we identify common use-cases, user journeys, and build easy-to-use experiences for our customers, like Apple did with the iPhone and took over the world. Microsoft has half-done this with winrm quickconfig so its not too far a leap to think that there might be a few simple steps to get this basic, basic stuff going. And I wasn't far off, see my answer. – Luke Puplett Sep 2 '16 at 16:48
  • @LukePuplett this is true, but realize the iPhone is a consumer facing device. The 'shell' of a server is not, nor should it be, consumer facing, it doesn't matter if it's Windows or Linux, there's no 'flip switch and it's working' cmdlet or script unless a sysadmin decides to make one. You're a programmer, you should probably leave server setup to a sysadmin, and don't assume 'anybody can do it'. Assuming there is a common use case from one server to the next is extremely dangerous, because there isn't. Even if there was, who's to say testing PS DSC scripts would fall in that category? – MDMoore313 Sep 2 '16 at 17:17
  • So I'm not a consumer of Windows? Okay mate. And look at my LinkedIn profile. I was Windows PSS engineer for Microsoft and then spent 7 years engineering award winning automation systems for a bank with 30,000 servers. Don't come on SO and tell me what I can and cannot touch. Because I think in terms of use-cases and useability, I became a software developer, because I have empathy for humans experiencing a product. Windows sucks in this respect. I also started the Unofficial Windows Uservoice that became official and is now the feedback tool in Windows 10. – Luke Puplett Sep 3 '16 at 9:54
0

I actually gave up. Here's how far I got. From PowerShell:

PS> iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
PS> choco install powershell

Reboot.

From elevated Command Prompt:

> winrm quickconfig
> winrm set winrm/config/service/auth @{Basic="true"}
> winrm set winrm/config/service @{AllowUnencrypted="false"}

And then I realised I'd need to make a certificate somehow and that would require makecert and that would require automating the installation of the Windows SDK, then I'd have to install the certificate, and some other documentation said something about WinRM not working with self-signed certificates and then thinking that after spending a week getting all that working only to discover that WinRM won't work anyway and then I lost the will to live.

I'm a programmer. I wanted to have a development Windows Server box for testing some PS DSC scripts out on but don't have an installation key to install it locally in Hyper-V and Microsoft haven't figured out to just give Windows Server away for free for developers yet, so I thought I'd use my free Azure time and setup a free VM and just use that over the web, but that requires HTTPS and so we're back to the problems above.

Hopefully my contract won't be renewed and I can just use .NET Core and Linux and Docker on the next job.

Edit

Stumbled randomly across this gem of a post about setting up SSL but without makecert:

https://4sysops.com/archives/powershell-remoting-over-https-with-a-self-signed-ssl-certificate/

  • You know you can download a free eval copy of Windows Server which is good for either 90 or 120 days? – mfinni Sep 2 '16 at 17:22
  • I tried, the form goes round and round in circles, and its no good long term anyway. – Luke Puplett Sep 3 '16 at 9:51
  • Before anyone else downvotes, the first two commands answer the headline question. – Luke Puplett Sep 3 '16 at 10:37
  • FYI, in a standard enterprise environment with AD, using Windows Certificate Services, a PKI, and/or GPOs will help handle this. I don't know if that's an option for you in your planned hosting environment. – mfinni Sep 5 '16 at 18:48
  • 1
    Well, for home use, ServerFault isn't the appropriate venue for the question, sorry to say. It's in the FAQ. – mfinni Sep 6 '16 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.