Friday, 27 May 2016

DFS Namespace Consolidation

My company had a stand-alone DFS namespace and wanted to move to a domain based namespace. As part of this, they wanted a new namespace setup. However, as some applications had the old namespace hard coded, there was a requirement to be able to use the old name for as well.

Once the old server was powered off, never to return, I was able to do this by following these steps:
  1. On the new file server, open regedit. Add the following:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dfs\Parameters\Replicated
New dWord value
Name it ServerConsolidationRetry
Set the value as 1

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dfs\Parameters\Replicated
New dWord value
Name it LogServerConsolidation
Set the value as 1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
New Multi-String value
Name it AlternateComputerNames
Set the value (one line each) to the FQDN of the old server (eg. Oldnamespace.domain.com)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
New Multi-String value
Name it OptionalNames
Set the value (one line each) to the NETBios name of the old server (eg. Oldnamespace)

  1. Create a new standalone DFS root with the old name with a hash (#) in front of the name - #oldnamespace
  2. Within the namespace (#oldnamespace), create the folder shortcuts required to point to the new folder targets
  3. In WINS, remove the entries for the old server names
  4. In DNS, remove any entries for the old server names then add new CNAMES to point the “oldnamespace” to the new server
  5. Delete the AD computer account for the old server
  6. Restart the Server service on the new server.

Wednesday, 25 May 2016

WinOps

Yesterday I went to the WinOps Conference (www.winops.org) in London.

There was a great mixture of speakers,

The event started with Jeffrey Snover, the Lead Architect for Windows Server, talking all about the new Windows Server 2016. It was really interesting to hear, at a high level, how the new version has been built with DevOps in mind. Also how the path limit issue has finally been resolved in the Nano server at least!

After the break, Ed Wilson, aka Scriping Guy, took to the stage. He talked about how the DSC (Desired State Configuration) feature in Azure Automation in OMS (Operations Management Suite) makes it easier to manage at scale.

Michael Greene, Principal Program Manager at Microsoft in the Enterprise Cloud Group division, was up next to talk about adopting a DevOps culture. I'm off to read his whitepaper from here: http://aka.ms/thereleasepipelinemodel

I attended three optional sessions (in that there were 6 talks / demos going on).

I chose to see Richard Siddaway. He was talking about DevOps with Nano Servers/Containers in Server 2016. The impressive part of this was deploying a VM and a container running IIS in under 5 minutes.

Next was a panel session on DevOps Culture in Windows World. This was 4 panelists answering questions about - you guessed it - DevOps!

The next session was a presentation from Peter Mounce of Just Eat. He talked about the Just Eat success in using DevOps and AWS.

The final session was another panel Q & A. All very interesting.

I left, disappointed to not win the Lego prize despite waving my arm in the air enthusiastically. Still, at least I got a free t-shirt, stress ball and some fruit pastilles for the train home!

Friday, 20 May 2016

Powershell: Get-ADuser filtering

I have recently been asked to extract some data from Active Directory for reporting purposes.

When I was working with much smaller AD directories so a command like Get-ADuser -filter * | where {$_.enabled -eq $true} didn't take long to complete. However, while I was waiting for a similar command to complete recently, I did some reading around best practices - the one of interest being filter from the left.

I gave it a try and compared the results.

The "where" command took 2.5 mins to complete. When I ran the same thing, using the filter, to get the same results, it took just 8 seconds!

Another thing I found was that filtering using wildcards on the DistinguishedName attribute doesn't work - if this is a requirement, you still have to use the "where" to filter.

Monday, 16 May 2016

DNS Wildcard

Today I was asked a new question – is it possible to add in a wildcard DNS entry so that *.subdomain.domain.com will respond to a ping.
I assumed that this would be possible.. and as expected it was after a little tweaking of the settings in DNS.

To set it up, I did the following:
Open the DNS console
Browse to “Forward lookup Zones” > domain.com
Right click > New Domain


In the box, put in the name of the subdomain
This creates something that looks like the following
I then went into the subdomain and created two A records – one with no name and one with * to point to the IP address I requested
However, when I opened up a command prompt and tried to ping anything.subdomain.domain.com it didn’t work.

The fix for this was to open the properties of the Forward Lookup zone “domain.com” and go to the WINS tab


I removed the tick from Use WINS forward lookup and victory – I could ping whateverIwanted.subdomain.domain.com

Monday, 9 May 2016

Disk cleanup – Server 2008 R2

One of the most common tickets I have ever had to work has been related to the C drive running out of space on a server.

The easy fix in the virtual age is to expand the VHD to clear the alert. However, sometimes this isn’t an option for whatever reason.

When checking the space, it is common to find that the WINSXS folder is huge thanks to all the windows updates that get installed over time.
Some time back, Microsoft released a "fix" to enable the cleanup of this folder. However, it does need the Desktop Experience to be installed. There are two things against this - 1 - it needs a reboot and 2 - its a server for goodness sakes!!

Here is the way round it:

Install KB2852386 – this does not need a reboot
Copy the following files:
> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe C:\Windows\System32\
> copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui C:\Windows\System32\en-US\
Run the cleanmgr.exe:


> cleanmgr.exe
This launches disk cleanup with the new option of "Windows Update Cleanup".