MDT imaging megapost – part 1 (our first server)

The great thing about working in the tech field is that it keeps moving on, ever changing, always evolving. That means sometimes you have to let go of systems that were once the bright shining light of progress once it becomes apparent something better has taken its place. Now is that time for my trusty ZCM 11 custom imaging system; built back in 2013 and star of a 6-part thread series I look back on now and think “wow, I actually did that”.

Until I moved imaging onto a Satellite the stats say the original Primary server pushed out over 5000 images. Given the length time the Satellite has been in place, plus the stats from our other sites that figure can easily be doubled and over the course of 4 years around 10,000 image cycles have been completed.

Compared to the previous process that was in place a huge amount of time was saved and allowed us to complete a large-scale Windows 7 migration with relative ease. Add to that a 4-year saving on ENGL license costs and my motley crew of Bash and PowerShell scripts can retire with a satisfied feeling of a job well done ūüôā

The future calls, and it’s shaped like the number 10…

However we need to move on, funny enough it’s another OS migration knocking on the door that prompted the change along with a shift in hardware and environment that meant the Linux-based PXE environment was starting to hold us back.

Windows 10 support from ZCM seemed patchy at best, as was timely support for new hardware such as Surfaces and their ilk. Reading the forums and email groups didn’t inspire much confidence either so we decided to start looking elsewhere.

SCCM was the natural direction of travel but having made a substantial investment of time creating ZCM Bundles we weren’t necessarily ready to move all that just yet. Similarly ZCM Patch Management works pretty well these days for covering our 3rd-party apps. With that in mind the Microsoft Deployment Toolkit was the obvious choice.

A nice GUI-based managed scripting environment with Windows PE as the underlying OS ticked all the boxes. Oh and did I mention it’s free!

It’s time for my own MDT… Massive Deployment Thread!

What originally started as a small side-project to push Windows 10 out to a couple of trial tablets has now expanded into a core system that’s been at the heart of our summer works. With that in mind it’s time to write up the journey and the numerous tips, tricks and tools used along the way.

Many of those ideas come from some of the best deployment pros in the business such as Johan Arwidmark, Michael Niehaus and Mikael Nystrom so a big shout out for all the knowledge they share. Hopefully this post will give an idea of how we put those pieces together in a live environment.

The beginning, our first server

Initially we started out deploying MDT for the sole purpose of imaging up a batch of demo Surface 3 devices so the first thing was to spool up a new VM with all the required software and roles installed. Links can be found below to save you some time:

Early fixes and customisations

After getting the basic Deployment Share running we hit a few minor issues that need resolving, which are worth bearing in mind:

Multiple DNS namespaces

We have two domains that are in use internally, one of which usually gets appended as part of the domain join process and the other via DHCP.

In the PE environment the machine isn’t domain joined and as such the default setting in Bootstrap.ini wouldn’t connect to the deployment share as it didn’t know the correct DNS suffix to append.

Ref: https://scottisageek.wordpress.com/2011/12/22/mdt-2010-and-multiple-dns-namespaces/

…we found it quicker in our case to change the DeployRoot setting to the MDT server’s FQDN rather than short name… problem solved ūüôā

Share permissions

The default permissions applied to the Deployment Share by the installation wizard weren’t set up as we liked. Can’t remember the exact reason now but looking back documentation on other sites I think the share needed locking down to prevent users viewing the Deployment Share content or (even worse) making unauthorised changes to it (!)

We now have specific AD groups and a service account set up so nominated MDT Administrators can read \ write to the share to upload Application install files etc. but the imaging account (more on that later) can only read and all other users are denied access by virtue of having no rights.

Set UK Locale

A quick an easy tweak sets up the keyboard settings for UK users in Bootstrap.ini

Ref: http://kabri.uk/2010/01/20/sample-bootstrap-ini-for-uk-deployments/

Similarly set them also in CustomSettings.ini

Ref: https://scriptimus.wordpress.com/2011/06/23/mdt-2010-sample-customsettings-ini-for-fully-automated-deployments/

There are quite a few other settings you’ll want to add in CustomSettings.ini but more detail on those will follow in relevant posts so keep your eyes peeled!

Update the Deployment Share

This is one action you’ll soon need to get into the habit of! If you make changes to the settings in any of the .ini files or add drivers that you’ll need in the PE environment (basically network and storage) then you need to update the Deployment Share.

This recompiles the Boot Images to include your changes, otherwise you’ll find all those nice new additions above make no difference whatsoever!

Think of this as step 1 / 2 to completely updating the Boot Images though. If the MDT wizard says that the Boot Images have changed you also need to copy the new WIMs over to WDS so PXE boot is using the latest images.

In WDS browse your server select Boot Images then¬†right click as per screenshot above and click Replace Image. Browse to your Deployment Share’s Boot folder and select the correct image for each architecture.

Windows Deployment Services service won’t start

At an early point in our testing WDS decided it didn’t want to start after a server reboot and was spewing error code 0x906. We weren’t sure why and were on the verge of reinstalling from scratch when I spotted this:

Ref: https://social.technet.microsoft.com/Forums/windows/en-US/265b4b53-63ac-491f-817c-6030daa39b81/cant-start-windows-deployment-services-service?forum=itprovistadeployment

As per Aaron Tyler’s advice in the link above run the wdsutil commands to uninitialize then reinitialize the server manually pointing to the RemoteInstall folder WDS creates.

wdsutil /uninitialize-server
wdsutil /initialize-server /reminst:[PATH_TO_REMOTEINSTALL_DIRECTORY]

Next time…

That should be enough to get your first server up and running. For the second post in the series we’ll look at the MDT Database and how it turns MDT from a good imaging solution into a great one ūüôā

Advertisements

Joomla adventures – rebuilding a community (part 2)

The post in this web development mini-series focuses on the products and tools that were used in the process of building and refining the new Metropower site http://www.metropower.info along with some lessons learned along the way.

Managing the project and resources

Early on in the build process it became apparent that our Facebook chat group wasn’t going to be sufficient to keep track of all the works that needed to be done to get the new site live.

To solve this I took another tip from my professional life, using Trello to manage tasks amongst the admin team and tracking the progress of content to be migrated from old site to new. For small projects it’s free, perfect!

We only needed to use the one board for managing the website project, although I have started another one up post-launch to keep track of bugs and website improvements. I initially wanted to use a Bug Tracker such as http://www.flyspray.org/ but ran out of databases on our hosting plan so put that on hold for the time being.

We also decided to set up a centralised Google account to store archive data, purchased plugins and so on. Using a Google account made sense as it would also serve as the account to use for Analytics as well. Drive has been handy as a secondary backup location too.

Social media and analytics

A few years ago one of the admin team set up a Facebook group as a first foray into social media; now we have coverage across a wide range of platforms:

  • Facebook Page – allows us to post “officially” as Metropower
  • Facebook Group – social discussion board that sees a lot of traffic that the forum used to serve. Excellent for quick responses but not so good for reference topics.
  • Facebook For Sale \ Wanted Group – saves our members paying eBay fees when trading parts between members (!)
  • Instagram – this used to be really powerful but appeal is a lot more limited now the TOU have changed and we can’t embed a hashtag gallery on our website
  • YouTube – event videos etc. but needs a bit of work for suitable content and branding

I also use Google Analytics to track site usage having completed a very well-timed training session at work on how to track campaigns and analyse user interaction.

We purchased a couple of Joomla plugins to pull dynamic content from social media onto the website. For example all events are managed via Facebook then embedded into the website so we only need to update content in one place. Using social media on the front page helps to keep it fresh but does come at a cost, more on that below…

Monitoring

If the site goes down for some reason I need to know about it and being used to having tools like PRTG Network monitor at work I wanted something similar for the site. Again fortunately there’s lots of high quality, business-grade free tools out there for personal use – I use two of them to make sure we’re covered:

After some issues with registration emails not arriving for Outlook.com users due to another user on the shared server being IP blacklisted we also set up an account with HetrixTools to keep an eye out for any similar occurrences in future https://hetrixtools.com

Website tuning and troubleshooting

With the site up and running the next stage was to tune its performance as initial page load speeds were somewhat slower than I was hoping. After doing some research via the Joomla documentation and third party sites I found some tools to benchmark the site and see what could be improved.

The main ones I use (in no particular order) are:

Immediately I could see issues such as content not being cached, CSS and JS files not minified \ compressed etc. Some could be fixed manually by adjusting settings on the server but it seemed the easiest way to fix others was to purchase an optimisation plugin for Joomla.

After browsing the JED I chose JCH Optimize and have been suitably impressed by the performance improvements since. We jumped from an F grade all the way up to A by following the recommendations from the tests above in addition to enabling JCH Optimize.

To check that your server supports the necessary GZip compression settings test it with https://checkgzipcompression.com

The only way we could speed things up further would be to move from shared to dedicated hosting (cost being the only reason we haven’t done so already) and to use a CDN to deliver content (a bit overkill really in this case).

One decision I have had to wrestle with was the choice between raw speed and community content. Running the tests above on the home page where we integrate with social media content drags the score right down into the red, due to a combination of multiple redirects (Facebook API), uncompressed images (Instagram thumbnails) and Javascript parsing (YouTube embedded player).

The moral of this story seems to be that if you want a fast-loading home page keep social media integrations well away from it.

Whilst writing this post I just spotted a potential workaround for the YouTube embeds¬†https://webdesign.tutsplus.com/tutorials/how-to-lazy-load-embedded-youtube-videos–cms-26743

After embedding the script into my template’s header there was a definite increase in page load speed and the YouTube scripts no longer appeared in the GTMetrix “Defer parsing of JavaScript” section of the report, a nice easy win there!

Next up

In the third post in this series I’ll go over some of the plugins used and the tweaks I made to get them integrated neatly in the site ūüôā

 

Image credits:

Icons made by Webalys Freebies from www.flaticon.com is licensed by CC 3.0 BY

Joomla adventures – rebuilding a community (part 1)

Sometimes work skills cross over into personal life and being the resident IT geek can come in rather handy. Cars are one of my passions outside IT and I’ve been a member of an owners group called Metropower for well over 10 years now.

When we came close to losing our old website due to issues with the previous web host I decided to take on the challenge of building a new one – the first major revamp since the site started in 2003 (!)

Outside of my usual network infrastructure work I enjoy indulging a more creative side as well so it seemed a good opportunity to combine two skill sets In the end I’ve surprised myself with what’s come out from the project and picked up some very useful tips and tricks along the way so that can only mean one thing… time for a new post series ūüôā

Getting up and running… crowdfunding

Metropower has always been a free-to-join community from the very beginning and as such we didn’t have any funds to draw on for the new website. With the vision I had in mind I knew we’d need some money to get the site up and running so we turned to crowdfunding… the ¬£300 goal was reached easily and gave us the investment we needed to purchase hosting and some very useful extras (more on that soon!)

Ref: https://www.justgiving.com/crowdfunding/metropower

It was great to see how valuable our members find the site and the community that’s been built from it and our aim with the new site was to build on that and go even bigger and better!

CMS platform… decisions decisions

When our site first started back in the early 2000’s web technologies were¬†very¬†different to how they are today. Our users were pretty much all accessing from desktop PCs and the portal software itself was pretty basic… to all intents a series of static web pages. Most interaction was made via forum threads and at the time users would visit multiple times each day to check for new posts.

Via the magic of the Internet Wayback Machine some screenshots of the old site below:

  

Moving forward to the present day a constant message was that the site needed to be mobile-friendly and from my personal perspective needed to present content more effectively. As such getting the platform right early on was going to be important. Social media has also taken over much of the role of the forum, although it turns out this form of communication still has a place albeit in a less starring role.

A few years back I tried out WordPress as a potential replacement but although I love the product as a blog platform it didn’t seem quite as convincing managing more structured content.

On the other hand I’d seen a fair bit of Joomla via work and as a CMS it seemed to fit the bill. Add in a wide range of extensions and the decision was made… Joomla it was.

With that in mind we chose a UK-based web host so our data was local to us. Quality of support was high on the list and after shopping around we were recommend to https://www.webhosting.uk.com/

Their live chat facility looked great and prices were very competitive with what we’d been offered elsewhere.

Theme

Although I wanted to retain the core branding from the old site I felt it needed to be merged with a more modern style such as Google Material design. As such a commercial theme was high up the shopping list to give us a quality base to build from. After searching across many theme sites the TechNews template from GavickPro caught my eye.

Ref: https://demo.gavick.com/joomla3/technews/

It ticked all the boxes for being clean, responsive and also included a few neat additional extensions such as NewsShowPro, again fitting the bill for presenting fresh content in a simple way.

The reviews section with it’s animated score sections was perfect for our “How-To Guides” section which gave a modern twist to the well-known Haynes manual “spanner ratings”or better known by that famous phrase “refitting is the reverse of removal” (!)

Other standard features you’d expect from a modern website such as social media sharing, print friendly view etc. are provided by a rather neat radial menu in the corner of the article’s cover image.

Branding & customisation

With the Technews base in place it was time to customise it to merge some core branding into the new site.

Using my favourite colour swatch tool ColorPix a few core colours were extracted from the old website and I set about customising the TechNews base to suit the Metropower brand. The built-in Chrome Web Developer tools come in very handy for this, the element inspector and  Computed CSS sections in particular are worth their weight in gold!

   

Taking feedback from our admin team on board the colours and styling continued to be tweaked for some time to get to a place where it looked “right”. It’s one of those things that’s really hard to quantity upfront, especially when working without a strict design brief but when it comes together there’s that moment when you realise the project is coming together and it’s a great feeling ūüôā

Images were an area we had to put a fair bit of effort into as our old photo stocks were far too low-res (2006 vintage) so all needed to be retaken afresh. Our members proved to be very helpful on this front and supplied images via social media and our new dedicated website Gmail address (one of many platforms this project ended up utilising, more on that later).

In advance of the site launch we sent out a teaser image on social media to give our members an idea of what was to come and the feedback was very positive:

Further customisations included:

  • additional navigation using Breadcrumbs Advanced module
  • textured header background to add contrast and depth to the theme
  • social media icons added to main nav menu

The screenshots below show stages of the build process:


standard TechNews theme with minimal customisation


adding sidebar modules, colour scheme CSS modifications and social media menu icons


breadcrumb nav module installed, textured header background and feature banners added

Documentation is king

As the design progressed I started to find I needed to dig deeper into the theme to achieve what I wanted. For example in our Store category I wanted a 2-column layout that wasn’t a standard feature of the theme so had to rewrite a new PHP layout file and CSS style to suit.

Given that I was doing this in spare time I knew I’d have to revisit some elements later on so decided quite early to write documentation for the customisations as I went along, in the same way I would if I was doing the project at work. Looking back 6 months later when adding new content I’m very grateful to my past self for making that decision!

  

A useful tip that I learnt from our web designer at work was to place a custom Administrator module into the Joomla back-end as the first thing that other admins would see when they logged in. We use this to remind people of the colour scheme hex codes, layout recommendations (image sizes etc.) and common locations for admin tasks. Again it’s something I’d recommend and have done on sites I’ve made since.

To do this go to Extensions > Modules, change the dropdown on the left from Site to Administrator then add a new Custom module in the cpanel position.

The next post will focus on the Extensions used to bring additional functionality to the site, as well as the various tools and platforms for optimisation, monitoring and management that have proved incredibly useful so far!

Build your own Thin-ish client with Windows 10 LTSB

After some positive user feedback from the launch of our new Server 2016-powered RDS setup I started wondering if it could have a wider use that just the remote access concept we initially wanted to address. One thought in mind was making use of old \ low-spec devices that would be a bit too clunky for running a modern OS but where the physical hardware itself was in good condition.

Chrome-OS esque distributions such as CloudReady sound nice but come at cost so I set up a little side-project to see if there’s anything that could be done with what we have on our licensing agreement or anything in the open-source space.

Looking around there do seem to be various thin-client “converter” products but again they all seem to be commercial e.g.¬†https://www.igel.com/desktop-converter-udc/

The only other option I found was ThinStation which may also be worth a look when I have more time as it seems a bit more involved to get set up and I wanted to stick to the Microsoft RDP client for now for maximum compatibility.

Windows options

Going back some time I remember Microsoft released cut-down versions of Windows for RDS-type scenarios; going back to the XP days it was called Windows Fundamentals for Legacy PCs and morphed into Windows 7 Thin PC in its next incarnation. Effectively all I want the OS to do is boot up, log in quickly then pass the credentials to a pre-configured RDP file using the standard mstsc.exe application.

However building any solutions on a Windows 7 base going forward seems to be a false economy so I decided to have a look around to see what was available on the Windows 10 codebase – the results were interesting…

IoT is name of the day

Going forward it seems Microsoft have changed the branding for this kind of cut-down devices to Windows IoT. In fact there’s a free edition which sounds ideal but it only runs on certain devices and isn’t really geared for UI use:

Ref: https://www.theregister.co.uk/2015/05/21/first_look_windows_10_iot_core_on_raspberry_pi_2/
Ref: http://blogs.perficient.com/microsoft/2016/01/windows-10-iot-editions-explained/

Reading a bit further it appears Microsoft license an edition called Windows 10 IoT Enterprise for new thin client devices. Now it gets interesting… it seems that the OS itself is Windows 10 Enterprise LTSB but with some special OEM licensing. It just so happens the edu customers get Enterprise LTSB on EES licensing so it’s time to take a closer look!

What this does mean is that Windows 10 Enterprise LTSB gets features from the old Windows Embedded products such as¬†Unified Write Filter, perfect for a locked down device that shouldn’t need to experience configuration changes to the base OS.

Ref: https://msdn.microsoft.com/en-us/windows/hardware/commercialize/customize/enterprise/unified-write-filter

All these features are available in Enterprise LTSB simply by going into Add \ Remove Windows Features window, look for the Device Lockdown section and add whichever ones meet your needs (more on this later).

Image & GPOs

After downloading the latest ISO the LTSB 2016 WIM was imported into MDT. I made a quick task sequence to get it up and running and deployed the OS to a Hyper-V VM.

Boot and logon speeds are very quick given the lack of any Modern Apps which usually need to be provisioned at each new login. The performance gain explains why quite a few people within education have used LTSB for their desktop builds against MS’ wishes; however they’ll miss out on new features such as the much-needed OneDrive Files on Demand that will only be provided to the Current Branch release.

In theory setting up a Mandatory Profile could speed up login even further but haven’t got round to trying that yet.

RDS domain SSO

Upon logging in with domain credentials the next aim is to seamlessly drop users into the RDS farm without any further prompts. After doing a bit of research this can be achieved by setting a couple of GPOs:

  • allow credential delegation
  • trust SHA1 signature of signed RDP file

The need to allow delegation of credentials is fairly commonly mentioned but a lot of the articles are old and don’t mention where this needs to be set in a 2016 farm. In fact you only need to allow the delegation on the FQDN of the Connection Broker based on the results of my testing so far.

Computer Configuration > Administrative Templates > System > Credentials Delegation

To avoid any unwanted prompts about trusting the signature of a signed RDP file populate the GPO mentioned above and copy \ paste the signature from the RDP file that is provided by RDWeb for whatever RDS Collection you want to connect to.

User Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client > Specify SHA1 thumbprints of certificates representing trusted .rdp Publishers

Custom shell

Now with the credentials side sorted out the final piece of the puzzle was to cleanly launch the session and (here’s the tricky bit) made a seamless logout once the RDS connection is closed. Now there’s a few ways to achieve the first part:

  • use the IoT Embedded Shell Launcher feature \ enable Kiosk Mode via System Image Manager
  • use the Custom User Interface User GPO

Ref: https://social.technet.microsoft.com/Forums/en-US/b4552957-45c2-4cc4-a13d-6397f06ee62e/windows-10-kiosk-build-embedded-shell-launcher-vs-custom-user-interface?forum=win10itprosetup

Ref: https://docs.microsoft.com/en-us/windows/configuration/set-up-a-kiosk-for-windows-10-for-desktop-editions

One thing to bear in mind with Shell Launcher is what happens when the shell i.e. mstsc.exe closes, you only have the choice of

  • Restart the shell.
  • Restart the device.
  • Shut down the device.
  • Do nothing

For the sake of speed logging off would be better so I decided to go with the Custom User Interface GPO – seeing as the Windows 10 device would be domain-joined anyway it also seemed a quicker more efficient way to configure multiple clients too.

Seeing as the Custom User Interface is a User GPO it goes without saying that Loopback Policy Processing needs to be enabled for the OU where the client resides. That also comes in handy for a few additional personalisation settings later on too.

The User GPO settings are summarised in the screenshot below, you can add more lock-down policies as you see fit:

Auto log-out on disconnect

Seeing as I wanted to automate the process as much as possible and all the devices would be domain managed anyway the GPO method seems to be the quickest way to achieve what I want. Also avoids needing to do an Add \ Remove Features step for each endpoint device.

Another important point is that the Shell Launcher method only provides options to relaunch the program, shut down or restart the machine. For speed I was aiming to log off the “client” when the RDS session is done so definitely going down the GPO route as a result.

In the GPO settings I initially tried the standard string you’d expect to launch a Remote Desktop session i.e.¬†mstsc.exe C:\Default.rdp but noticed some strange behaviour:

  • Windows logs in
  • RDP file launched
  • connection starts
  • before the green bar completes i.e. handshake still in progress
  • host session logs out

This seemed like a behaviour I’ve seen with some other programs in the past where they appear to terminate mid-way through actions actually occurring. To check I tried manually with the “start” command with the same result. It appears mstsc.exe doesn’t play nicely so we need another way…

Plan b) was to monitor the mstsc.exe process then log out from the client once RDS disconnected and therefore the process was no longer running. After looking around and trying a few scripts out I settled on one I found here:

Ref: https://www.experts-exchange.com/questions/24218998/Check-if-a-process-is-running-in-vbs.html

Just add the logout command as the action to run when the desired process terminates and we have the desired behaviour. It takes a second or two to react to the process closing but there doesn’t seem to be a way to speed that up as far as I can see.

Final steps

Now just some finishing touches required to give the solution a bit of polish ūüôā

  • set logon and desktop wallpaper
  • disable Task Manager and related lockdown setings

When the machine boots users see this login screen, easily customised via GPO…

After login connection to RDS is pretty much immediate and no further credential \ security prompts appear…

UWF

The final piece of the puzzle is tidying up after the client has been in use for a while. That’s where the Unified Write Filter from earlier comes in handy:

Enable-WindowsOptionalFeature -Online -FeatureName Client-UnifiedWriteFilter

Then enable the filter;

uwfmgr.exe filter enable

Ref: https://docs.microsoft.com/en-us/windows-hardware/customize/enterprise/unified-write-filter
Ref: https://developer.microsoft.com/en-us/windows/iot/docs/uwf
Ref: https://deploymentresearch.com/Research/Post/632/Using-the-Unified-Write-Filter-UWF-feature-in-Windows-10

And there you have it, a locked down RDS client that will run on older hardware (Windows 10 works on pretty much anything from the last 10 years) which can be managed through your standard AD infrastructure, all using stuff you already have access to via your Campus agreement… enjoy!

Quick tips: custom port speed sensor for PRTG

We use PRTG Network Monitor at the College to monitor devices right across the network, from switches and firewalls right down to host \ VM \ application level for servers.

Recently I started playing a bit more with the network maps to try and build some “living” documentation that would give us live traffic stats whilst also satisfying the requirement of having some up-to-date network diagrams.

Port speed

Adding the devices and links was simple enough but we also wanted to display the uplink speed. Partially as it’s handy to visualise what goes where and also from a practical point of view to check if a link degrades.

However I couldn’t find a straightforward option to do this. It seemed possible as PRTG does actually display the speed when¬†selecting ports to monitor but then doesn’t make the data available as a channel once added to the Devices list ūüė¶

A bit of research confirmed I wasn’t going mad:

Ref: https://kb.paessler.com/en/topic/14843-how-to-see-port-speed-on-switches

Having the speed on the port name is nice but that’s a bit too wordy to be able to spot from a distance and being a text label isn’t really something that could be “monitored” if the value changes. However the comment about “ifSpeed” did give me an idea…

Custom library time

I’d already used the PRTG MIB Importer quite a few times bringing in libraries for various devices on the network so wondered if there was a value¬†I could use to make a custom sensor. There was nothing in the device specific files for our switches so I figured that the value must be more generic \ standard than that.

Soon found this very handy website that walks through the SNMP OIDs; lo and behold there’s the ifSpeed values!

Ref: http://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.31.1.1

Well in fact it’s a slightly different value called ifHighSpeed, the reason why it’s required for 10GB interfaces is referenced below:

“That is because when using ifSpeed,¬†the output value will exceed the max. value (4,294,967,295) ¬†that the object can support.”

Ref: https://supportforums.cisco.com/discussion/11124321/what-should-be-ifspeed-and-ifhighspeed-2-gig-interfaceport-channel
Ref: https://kb.juniper.net/InfoCenter/index?page=content&id=KB9119

After trying out the values using the free Paessler SNMP Tester¬†along with the MIB Importer eventually brought me to the setup below, which has a nice little bonus of also showing the port’s name when selecting it in PRTG for easier identification. Note the other OIDs to obtain port name etc.

Once done it’s then a simple matter of saving the newly created file for use in PRTG and adding an SNMP Library sensor in to a test device.

Once added the sensor displays like this (port name can be changed as required)

Map display

The sensor was working well at this point but¬†there was one final tweak required before getting the display I wanted. PRTG’s default template for a value-only map item adds the device’s name to the label, which in our case made for quite an unsightly string of text that got in the way of other map elements.

The solution? Go to your PRTG folder which looks something like

*install path*\PRTG Network Monitor\webroot\mapobjects
  • copy the item template in question, in this case it was “An icon B2.html” and name it as required.
  • edit the copied file to remove the “ParentDevice” string highlighted below.
  • also note you need to change the display name¬†at the top of the file to something unique

Compare the before and after shots below:


original PRTG file


updated file with name edited and ParentDevice string removed

Once done open up the PRTG Administration Tool then restart the Core Server Service as per screenshot below:

End result

Now when you look in your map icons you’ll see the additional option appear as you named it above.
Drag that in and you’ll get the output in the format below, nice and clean ūüôā

Server 2016 RDS via Azure AD Application Proxy end-to-end guide

remote_desktop_blueOne of our priorities for this year was to improve our remote access offering to staff to enable more flexible working whilst outside of college. Office 365 helps greatly and has already improved functionality in many ways but there’s still some legacy applications and classic file shares that need to be provided remotely too. If at all possible we prefer the files not to leave the network so some form of virtual desktop looked the way to go.

After discounting VMware and Citrix offerings on cost grounds the improvements to Microsoft’s RDS offering in Server 2016 seemed to come at a perfect time.

Even more so now we’ve implemented Azure AD Application Proxy (more on that shortly!) We’ve also recently decommissioned some services that freed up a bit of physical hardware resource to “play” with so away we went!

Server installation

The physical hardware for now is running on some reclaimed Dell PowerEdge R610 servers; 64GB RAM, dual CPU and 6 x 15k disks in RAID10. Should be plenty to get us up and running with the RDS roles eventually split across two hosts. For now we’re running on just the one but even that’s plenty to get up and running with.

We installed Server 2016 Core running the Hyper-V role, which was simple enough. The Core role looks to be a tad more polished in Server 2016, although not new the sconfig tool got the main settings entered with fairly minimal fuss.

r610
yes it will go back in the rack once we’re done with it!

Getting the OS to update correctly wasn’t so simple due to Microsoft doing something silly to the update mechanism in the initial release of Windows 10 1607 and its equivalent Server 2016 release. Update status was stuck on “Downloading” showing no signs of progressing. In the end manually installing the latest Cumulative update release from the Microsoft Update Catalog did the trick e.g.

wusa.exe windows10.0-kb3213986-x64_a1f5adacc28b56d7728c92e318d6596d9072aec4.msu /quiet /norestart

Server roles

With Hyper-V up and running the next stage was to install our guests. We went with 3 VMs set up as follows:

  • Connection Broker \ RD Licensing
  • RD Web Access \ RD Gateway
  • RD Session Host

The original plan was to try and embrace the Server Core concept and only install the GUI where absolutely necessary. With that in mind we made the first two servers with Core and only the Session Host with a GUI. More on that soon… (!)

add-roles-wizard
RDS deployment wizard Role Services

Running the deployment through Server Manager on my desktop was easy going, Microsoft have done good work with this and the deployment doesn’t seem too far removed from the 2012 R2 guides I’ve been looking at online. We added each server to the roles as per above, got to the final screen and hit the magic Deploy button then…

"Unable to install RD Web Access role service on server"

Role service... Failed
Deployment... Cancelled

Well that didn’t go to plan! We had a look online, trying to find reasons for the failures and went through some initial troubleshooting to make sure all recent updates were installed and each server’s patches matched exactly, also enabled Powershell remoting…

Enable-PSRemoting -force

…still no joy until we found this little nugget of information…

Ref: https://social.technet.microsoft.com/Forums/Sharepoint/en-US/b5c2bae3-0e3b-4d22-b64d-a51d27f0b0e4/deploying-rds-2012-r2-unable-to-install-rd-web-access-role-service-on-server?forum=winserverTS

So it appears the RD Gateway \ RD Web Access role isn’t supported on Server Core. Of course we wouldn’t want the web-facing part of the deployment running on a server with reduced attack surface would we Microsoft… not impressed!

Ref: https://technet.microsoft.com/en-us/library/jj574158(v=ws.11).aspx

To confirm the hypothesis running Get-WindowsFeature on Server 2016 Core gives this…

server-core-available-rds-roles
Server Core

and on Server 2016 with GUI gives this…

server-gui-available-rds-roles
Server with GUI

Published names & certificate fun and games

After begrudgingly re-installing one of the VMs with a GUI (seemed quicker than trying to convert the Core install) we managed to get past the final Deploy page with 3 success bars ūüôā

The first key setting we were asked for was the external FQDN for the RD Gateway, which was added to our ISP-hosted DNS records. We use a wildcard certificate to cover our external facing SSL needs, nothing out the ordinary there and went on to apply it to each of the four roles specified by the RDS Deployment wizard. A Session Collection was created for a test group and pointed at the new Session Host. All looking promising.

The RD Gateway FQDN naming in itself wasn’t a problem but led us to an¬†interesting part of the setup relating to SSL certificates and domains. Once we had the RDS services accessible from outside the network (see below) I fired up my 4G tethering to give it a test.

The connection worked but threw up a certificate warning and it was obvious to see why. Our wildcard certificate is for *.domain.ac.uk but the Connection Broker’s published FQDN is servername.subdomain.domain.ac.uk and therefore isn’t covered.

Fortunately a Powershell script called Set-RDPublishedName exists to change this published name and works a treat! Grab it from https://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80

You’ll also need to ensure that you can access the new published name internally, depending on what form your internal domain is vs. your external you may need to do a bit of DNS trickery with zones to get the records you need. More on that can be found at:

Ref: https://msfreaks.wordpress.com/2013/12/09/windows-2012-r2-remote-desktop-services-part-1
Ref: https://msfreaks.wordpress.com/2013/12/23/windows-2012-r2-remote-desktop-services-part-2

set-rdpublishedname
Set-RDPublishedName script in action

External access via Azure AD Application Proxy

We published the RD Gateway and RD Web Access via our new shiny Azure AD Application Proxy for a few reasons…

  • simplicity, no firewall rules or DMZ required
  • security, leverages Azure to provide the secure tunnel
  • SSO, use Kerberos Delegation to sign into RD Web Access as part of the user’s Office 365 login

I followed the excellent guides from¬†Arjan Vroege’s blog¬†for this, in particular the section regarding how to edit the RD Web Access webpage files… nice work Arjan!

Publish your RDS Environment with Azure and AD Proxy – Part 1 –¬†http://www.vroege.biz/?p=2462
Publish your RDS Environment with Azure and AD Proxy – Part 2 –¬†http://www.vroege.biz/?p=2563
Publish your RDS Environment with Azure and AD Proxy – Part 3 –¬†http://www.vroege.biz/?p=2647

As per my previous post on Azure AD Application Proxy & Kerberos delegation use the command below to add the SPN record (replace the FQDN and server name as appropriate)

setspn -s HTTP/servername.subdomain.domain.ac.uk servername

When done the end result is a seamless login to RD Web Access via the Azure AD login page. In our case the link will eventually end up as a button on our Office 365-based Staff Intranet, therefore not requiring any further logins to get to the RDWeb app selection screen.

I particularly wanted to avoid the RDWeb login screen, which I’m amazed in 2017 still requires DIY hacks to avoid the requirement to login with the DOMAIN\username format. Thought Microsoft would’ve improved that in the Server 2016 release but evidently not.

One more gotcha

So having done all the hard work above preparing the login all that was left was to click the Remote Desktop icon and enjoy, right? Wrong.

After running the¬†Set-RDPublishedName script the certificate warning went away and I could see the change to the new wildcard-friendly name, however the connection attempt now failed with the error¬†“Remote Desktop can’t connect to the remote computer *connectionbrokername* for one of these reasons”

remote-desktop-cant-connect
connection failure after changing Published Name

Neither explanation made any sense as the connection was working perfectly fine until changing the Published Name. Indeed changing it back to the original FQDN of the Connection Broker restored service so it had to be something to do with that. After being stumped initially I came back after food (always helps!) then after a bit more research found this very helpful post:

Ref: https://social.technet.microsoft.com/Forums/windowsserver/en-US/4fa952bc-6842-437f-8394-281823b0e7ad/change-published-fqdn-for-2012-r2-rds?forum=winserverTS

It turns out the new FQDN we added when changing the Published Name needs to be added to RDG_RDAllConnectionBrokers Local Computer Group.

This group is used to approve connections in the Resource Authorization Policies (RD-RAP) section of RD Gateway Manager. By default only the server’s domain FQDN is present in the list (as you’d expect) so it appears unless you add the new Published Name in there the connection attempt gets denied.

To add your external published name follow these steps:

  • Server Manager > Tools > Remote Desktop Services > Remote Desktop Gateway Manager
  • expand your RD Gateway server > Policies > Resource Authorization Policies
  • Click Manage Local Computer Groups on the right hand pane
  • Select RDG_RDConnectionBrokers > Properties
  • Click the Network Resources tab
  • type the FQDN of the Published Name you supplied to the Powershell script earlier then click Add
  • OK all the way out then try your connection again

manage-locally-stored-computer-groups
RD Gateway Manager

The example below replaces the real server names with dummy entries but should illustrate the concept. The same scenario applies if your servers exist in a .local Active Directory domain (which will be the top entry) and your external domain is something different (again remember to sort out internal DNS zone entries to suit)

add-external-name-to-rdcbcomputers-group
Manage RDG_RDCBComputers group

Finishing touches

Once all the above is done you should then get a connection, there is one seemingly unavoidable credential prompt due to Microsoft persisting with using an ActiveX control to start the RDP session but perhaps one day they’ll update it (we live in hope). It seems you can use the UPN style format here which is handy as it keeps things consistent. In a way it’s a bit of a security measure so not the end of the world.

Now the connection itself is sorted out all that’s left is to tweak the Session Host to our requirements. This guide gives some nice pointers on locking down the server via GPO:

Ref: http://www.it.ltsoy.com/windows/lock-down-remote-desktop-services-server-2012

We also push out a custom Start Menu using the newer Windows 10 1607 GPO settings along with the Export-StartLayout command. Finally install any programs required, remember to change the mode of the server first:

Ref: https://technet.microsoft.com/en-us/library/ff432698.aspx

change user /install

Then once done

change user /execute

Now enjoy ūüôā

rds-screenshot
Connection to Server 2016 RDS Session Based desktop via RD Web Access \ RD Gateway