PowerShell for Windows Admins


May 28, 2016  8:14 AM

Slides and Code from my WinOps 2016 talk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DevOps

The slides and code from my WinOps 2016 talk can be found here:

https://onedrive.live.com/redir?resid=43CFA46A74CF3E96!79154&authkey=!AKIt7btEZsahTf8&ithint=file%2czip

May 26, 2016  1:15 PM

DHCP scope

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DHCP

After rebuilding my test machine for Server 2016 (with mixed results) I needed to add a DHCP scope to the environment. I blogged about the DHCP PowerShell module several years ago.

To quickly add a DHCP scope to the current server

Add-DhcpServerv4Scope -Name ‘Manticore Scope’  `
-StartRange 10.10.54.2 -EndRange 10.10.54.30 `
-Description ‘Scope for Manticore domain’ `
-Type DHCP -State Active -SubnetMask 255.255.255.0 `
-LeaseDuration (New-TimeSpan -Days 2)

Set-DhcpServerv4OptionValue  -ScopeId 10.10.54.0 -DnsServer 10.10.54.201

I’ll save this as I’ll have to rebuild the machine when Windows 2016 RTM’s and possibly again if I can’t get the wireless adapter to work then.


May 26, 2016  11:52 AM

Windows server 2016 TP 5 activation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Windows Server 2016

Having finished the current round of conference speaking I needed to upgrade my system to Windows 2016 TP5. I’m using a 6 year old Lenovo W510 system.

First problem is that I couldn’t get the wireless adapter working – after a lot of searching I saw a post with a similar issue due to the Wireless LAN Service which you need doesn’t install correctly. Server Manager and Get-WindowsFeature both show it as installed but the wlansvc service isn’t available – doesn’t show in in the services GUI or through Get-Service.

Telephone activation is a pain but works BUT if an internet activation fails you don’t get the telephone option.

This post http://www.urtech.ca/2016/02/solved-how-to-activate-windows-10-server-2016-through-command-line/

saved the day.

Basically type SLUI 4 in the run dialog to open the manual activation  dialog.

Hope this is fixed for RTM otherwise I’ll need a new machine.


May 26, 2016  5:12 AM

Y shaped people

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DevOps

During the WinOps conference – http://winops.org/ – I attended a session on DevOps culture. At one point the discussion got on to skill sets.

I introduced the concept of the Y shaped skillset.

You should have a deep understanding on at least one area – C# development, Active Directory, web development, Exchange management – whatever it is you should a ‘go to’ person for that area. That’s represented by the down stroke of the Y

In addition in a devops world you ideally need a bunch of skills that span the devops range. At the top you should have a broad understanding across the range of skills – at least enough to have sensible conversations with other practitioners. Those skills can be backed up with a few areas that complement your main skill as you drop deeper into the Y.

Over time you may see your main skill set change and what was your primary skill migrate into a secondary area to be replaced by something else.

Next time you’re wondering what to learn – think of this model and think about what skills you need to add to complement and build on your current skill set


May 18, 2016  3:51 AM

Windows container providers

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
containers, Windows Server 2016

Containers are a new feature in Windows 2016. I was preparing for my talk at the WinOps conference next week – http://winops.org/ – and realised I needed the container OS image for nano server

I discovered that there are 2 container image providers available through the PowerShell gallery.

In TP4 I used the ContainerProvider provider. That still exists BUT only supplies the TP4 images

PS>  ContainerProvider\Find-ContainerImage | ft -a

Name              Version      Source Description
—-              ——-      —— ———–
NanoServer        10.0.10586.0        Container OS Image of Windows Server 2016 Technical Preview 4 : Nano Server Installation
WindowsServerCore 10.0.10586.0        Container OS Image of Windows Server 2016 Technical Preview : Windows Server Core Installation

If you want the TP5 images you have to use the ContainerImage provider

PS>  ContainerImage\Find-ContainerImage | ft -a

Name              Version         Source                Summary
—-              ——-         ——                ——-
NanoServer        10.0.14300.1010 ContainerImageGallery Container OS Image of Windows Server 2016 Technical Preview 5 : Nano Server I…
WindowsServerCore 10.0.14300.1000 ContainerImageGallery Container OS Image of Windows Server 2016 Technical Preview 5 : Windows Serve…

This isn’t very satisfactory and will cause lots of confusion in the long term. I just hope we’re not getting a new provider with every new version of Windows 2016


May 11, 2016  12:03 PM

Cloud Native Applications

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Books, Cloud Computing

Cloud Native Applications is a collection of hand-picked chapters presenting five topics that will give you insights into the world of cloud computing.  The link is here: http://bit.ly/1T46wP7

This is excellent value – its FREE.

You’ll find chapters on:

Amazon Web Services

Docker

Mesos

RabbitMQ

Netty

Enjoy

 


May 5, 2016  12:12 PM

PowerShell and Nano server

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell, Windows Server 2016

Nano server is the new install option introduced with Windows 2016. It has a really tiny footprint compared to a server core machine.

Of course it has PowerShell but its not a complete port of the PowerShell you’re used to. The features that aren’t present are detailed here:

https://technet.microsoft.com/en-us/library/mt671124%28v=ws.12%29.aspx

What you get is PowerShell re-written for .NET core

If you want to develop your own cmdlets try this article to get you started:

https://blogs.msdn.microsoft.com/powershell/feed/


May 2, 2016  7:45 AM

Loading assemblies

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell is .NET based but doesn’t load all available .NET assemblies when it starts.

Many people still use something  like

[System.Reflection.Assembly]::LoadWithPartialName(‘System.Windows.Forms’)

to load additional assemblies.  This is a hang over from PowerShell v1 when there wasn’t another way to perform the load.

The LoadWithPartialName method has been deprecated – https://msdn.microsoft.com/en-us/library/12xc5368(v=vs.110).aspx – and shouldn’t be used.

Your alternatives are:

Add-Type -AssemblyName System.Windows.Forms

or in PowerShell v5

using assembly System.Windows.Forms

using namespace System.Windows.Forms

can be used

 


April 29, 2016  1:25 PM

Free ebook: IoT

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
e-books, iot

A free ebook from Manning: Using the Web to Build the IoT is a collection of six hand-picked chapters that introduce the key technologies and concepts for building the application layer of the IoT.  The page is here: http://bit.ly/1SUJW0P


April 29, 2016  5:13 AM

WinOps conference

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DevOps, Powershell

The WinOps conference is dedicated to ‘Windows in a DevOps World’  Its in London 24 May 2016. I’ll be speaking as will Jeffrey Snover and Ed Wilson of Microsoft.

More details from http://winops.org/

Hope to see you there


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: