Install and Setup ADFS 2.0 on a Windows Server

ADFS, Blog, Information Technology, Microsoft, Servers, Software, Windows

Note: This guide assumes you have a Windows server, it is joined to a domain and you have an account that is part of the domain admins group.


 

First we need to install ADFS 2.0

  1. To install version 2.0, it first needs to be downloaded and installed. Click this link to download the installation file https://www.microsoft.com/en-au/download/details.aspx?id=10909
  2. Choose the type of installation file based on your OS (I am running Server 2008 R2 so I will choose RTW\W2K8R2\amd64\AdfsSetup.exe). Save the installation file to your Desktop
  3. Run the exe located on your desktop
  4. On the Welcome screen, click Next
  5. Accept the License Agreement.
  6. I will be setting this ADFS server as a Federation server so I will leave the default of Federation Server selected and I will click Next. Note: you would select Federation server proxy if you were running your ADFS server in something like a DMZ.
  7. Click Next on the prerequisite software screen. The install wizard will install these automatically if they are not already present on the system. If there are no errors, the software will be installed and the ADFS 2.0 management window will open

The next task is to create a certificate template to use with our SSL certificate

  1. The first thing you need to do is open the Server Manager (Start > Administrative Tools > Server Manager)
  2. Select Roles
  3. Click Add Roles
  4. Click Next to get past the Welcome Screen
  5. Check off Active Directory Certificate Services and click Next
    Select Roles
  6. Click Next to get past the Welcome Screen
  7. Click Next on the Role Services page
  8. Leave the default of Enterprise selected and click Next. Note: if Enterprise is not an option, you must log out of the server and log back in using an account that is a member of the Domain Administrators group.
  9. On the next page you need to decide between choosing a Root CA or a Subordinate CA. Select Root CA if you are OK with using a self-signed certificate for your ADFS instance. Select Subordinate CA if you would like to purchase a certificate from a 3rd party certificate authority. I will be using a self-signed certificate so I will select Root CA and click Next.
  10. Click Next on the Private Key page to create a new private key.
  11. Choose the type of cryptography you would like to use on the next page. I will leave the default of SHA1 with a 2048 bit key character length, but you can choose whatever you want. Then click Next
  12. Click Next on the CA Name page
  13. Choose how long you want the certificate to be valid. I will leave the default of 5 years set. Click Next
  14. Click Next on the Certificate Database page
  15. Click Install to finish and then close the wizard when complete
  16. Next open up the Certificate Authority (Start > Administrative Tools > Certificate Authority)
  17. Expand your server on the left column, right click Certificate Templates and click Manage
    manage
  18. Scroll down to the end of the list, right click Web Server and click Duplicate Template
    Duplicate Template
  19. Select Windows Server 2008 Enterprise and click OK. Note: you would select Windows Server 2003 only if you had 2003 servers on your network that needed to access the ADFS services.
  20. Give the template a name (ex: ADFS SSL Certificate)
  21. Next click on the Subject Name tab at the top.
  22. Click the Build from this Active Directory information radio button, select Common Name from the subject name format dropdown, uncheck User principal name (UPN) and check DNS name
    Template Properties
  23. In order for the ADFS server to obtain a certificate, it needs to have the correct permission set up to do so. To do this, select the Security tab at the top.
  24. To add the required permissions, click the Add
  25. Click the Object Types… button, check Computers on the newly opened window and click OK.
    Object Types
  26. Enter the name of the server that you previously installed ADFS on and click OK. The server will be added to the permission list.
  27. Next we need to set Enroll the allow permission for this particular server. Check Enroll and click OK
    Template Properties - Security
  28. Now we need to make this certificate template is available to be used to issue certificates. To do this, open up the Certificate Authority window again (Start > Administrative Tools > Certificate Authority)
  29. Right click the Certificate Templates icon in the left column, hover over New and click Certificate Template to Issue 
    Certificate Template to Issue
  30. Select the name of the template you made previously (in my example I made it ADFS SSL Certificate) and click OK.

The next task is to create a SSL certificate on the server that is compatible with ADFS

    1. Open up a management console window on your server (Start, type in mmc.exe and hit enter)
    2. Click file and click Add or Remove Snap-ins
    3. Highlight Certificates and click AddCertificates
    4. Select Computer Account and click Next and then click Finish
    5. Now that the options are configured, click OK
    6. On the Console window, click View and then select Options
      Options
    7. Select Certificate purpose and then click This will allow us to view the computer’s certificate by their purpose.
    8. In the Intended Purposes view, right click Server Authentication, hover over All Tasks and click Request New Certificate
      Request New Certificate
    9. Click Next on the welcome screen.
    10. Click Next on the Select Certificate Enrollment Policy
    11. Select the template you created before (ex: ADFS SSL Certificate) by checking it and clicking Enroll.
      Enroll
    12. Click Finish and close all of the open windows.

 

The next task will be to configure ADFS

  1. Open up ADFS management (Start > Administrative tools > AD FS 2.0 Management)
  2. On the ADFS 2.0 management window, click ADFS 2.0 Federation Server Configuration WizardWizard
  3. Leave the default of Create a new Federation Service selected and click Next
  4. On the Select Deployment Type page, select Stand-alone federation server and click Next
  5. Make sure your SSL certificate is selected on the Federation Service Name page and click Next
  6. Click Next on the summary screen and wait for the wizard to complete.
  7. One the wizard is finished, click Close. Now ADFS is installed and ready to be used.

 

Upgrade Active Directory Functional Level

Blog, Information Technology, Microsoft, Servers, Windows

If you are a systems administrator for an older company (like me), you probably have a few servers running Microsoft’s Windows Server 2003 operating system on your network. Most sysadmins are aware that support for Windows Server 2003 will end on July 14, 2015 (6 days from writing this post), which means no more software and security updates from the folks over in Redmond. Luckily our company has a big enough IT budget to have purchased Server 2008 licenses a long time ago but migrating servers is a slow and daunting task. One of the last 2003 servers we have on our network is a 2003 domain controller. Replacing this DC are two 2008 R2 AD servers but we need to demote the 2003 server and raise the functionality level of our domain so we can use new features like the AD recycle bin which lets admins restore deleted objects from active directory. Older AD functionality is still supported so any applications or services that used those functions will continue to work as before.

 


 

First we need to run demote the 2003 server.

Note: you need to have at least another domain controller in your network, otherwise you will lose your entire AD.

  1. On your 2003 domain controller, log in using a domain admins account.
  2. Click Start, and then click Run.
  3. In Open, type dcpromo to open the Active Directory Installation Wizard, and then click Next.
  4. On the Remove Active Directory page, click Next, and then continue to follow the wizard.

After your server is demoted, we need to raise the functionality of our domain.

To check the functionality level of your domain, open up powershell and type these commands

# Get the Forest functional level            
(Get-ADForest).ForestMode            
            
# Get the Domain functional level            
(Get-ADDomain).DomainMode

And you should get results like mine.

domain

Now, lets raise the functional level….

On your 2008 domain controller, open up Active Directory Domains and Trusts, right click your domain and click Raise Domain Functional Level… 

level

On the Raise domain functional level page, choose Windows Server 2008 if you AD is running Server 2008 or Windows Server 2008 R2 if you are running Server 2008 R2. Click Raise.

raise

That is it for the domain.

To raise the forest functional level, on the same Active Directory Domains and Trusts page, right click Active Directory Domains and Trusts and click Raise Forest Functional Level… 

level forest

Pick the appropriate forest functional level from before and click Raise.

raise forest

Check to see if the levels were raised using the same powershell commands from before.

# Get the Forest functional level            
(Get-ADForest).ForestMode            
            
# Get the Domain functional level            
(Get-ADDomain).DomainMode

You should see your updated results.

domain-new

And that is it. Good luck with the rest of you migration!

Enable Remote Desktop on a Remote Windows Server

Blog, Information Technology, Microsoft, Servers, Software, Windows

Scenario: you just finished installing some brand new servers in your server racks at the data center. You plugged them into your network, updated them with the latest windows updates and figured that you can finish the rest of the configuration while sitting at your desk at the office. Unfortunately you forgot to enable remote desktop and there is no way to get into the new machines.

Doh

Instead of driving all the way back to the data center, you can use these steps to enable remote desktop… remotely.

Steps

First you need to install PsExec from the Microsoft website http://technet.microsoft.com/en-us/sysinternals/bb897553

Extract the zip file, open a command window and cd to the newly extracted directory. (Ex. I extracted to a folder on my desktop called PSTools. Start>Run>Cmd>”cd  C:\Users\Developer\Desktop\PSTools”)

Next you need to run the command listed below. Mofidy the command by changing remoteserver to the IP of the remote server.

psexec \\remoteserver reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0

remoteregistry

This sets the registry value on the remote machine to enable and disable remote desktop connections.

Now we need to add the firewall exceptions to allow us remote access. Again, modify the commands below by changing remoteserver to the IP of the machine.

psexec \\remoteserver netsh firewall set service remoteadmin enable
psexec \\remoteserver netsh firewall set service remotedesktop enable

netshfirewall

After running those two commands, you should be able to remote desktop into that machine.